Edit History on Database using Spring - spring

I would like to know if a framework or a component (or even a Spring project!) exists that would allow me to save the history (automatically, or via #Java tags) of all edits done on a specific model object within my Spring project.
Thanks in advance,
Sammy

You are looking for a tool for auditing like Hibernate Envers. It works like a revision system for your DB entities.
Hibernate's integration with Spring is pretty straight forward, as well.
See also:
Hibernate Envers Docs

Related

Why that Spring Framework Documentation's table of contents is gone?

I remember there was a table of contents in the document before but now is gone.
That makes it inconvenient to find the specified chapter.
And I see the other's project still has the table of contents.
Is it something wrong with this doc page?
Spring Framework Documentation:
https://docs.spring.io/spring-framework/docs/current/reference/html/core.html
And others project like Spring Boot :
https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features
I have the same symptoms, but with Spring Framework project, not Spring Boot. I managed to download PDF versions of the topics. They're at:
https://docs.spring.io/spring-framework/docs/5.3.9/reference/pdf/core.pdf
https://docs.spring.io/spring-framework/docs/5.3.9/reference/pdf/testing.pdf
https://docs.spring.io/spring-framework/docs/5.3.9/reference/pdf/data-access.pdf
https://docs.spring.io/spring-framework/docs/5.3.9/reference/pdf/web.pdf
https://docs.spring.io/spring-framework/docs/5.3.9/reference/pdf/web-reactive.pdf
https://docs.spring.io/spring-framework/docs/5.3.9/reference/pdf/integration.pdf
https://docs.spring.io/spring-framework/docs/5.3.9/reference/pdf/languages.pdf
https://docs.spring.io/spring-framework/docs/5.3.9/reference/pdf/appendix.pdf
Both links lead to Spring features

making changes to database with hibernate

so im quite new to all spring and hibernate so i used a feature in myeclipse called generate CRUD application (it uses spring and hibernate for the heart of the application and JSF for presentation objects)that im intended to make changes so that i can work with .. my question is the following .. after i made the application that works fine by the way , i discovered that there are fields and probably even tables to be added to the database(an oracle 11g instance database)..so my questions are the following:
if i create the classes and update the existing .. will it be written directly in the database?
if not is there any way to do it because i dont think a direct update in the database will be a good idea ..
thank you in advance ..
If I understand correctly, you want to know whether the database schema can be created/updated automatically from your #Entity classes, and how to enable/disable such creation. Yes, it's possible by using some property. The name of the property would depend on your project kind. For example, in a default Spring Boot application, you can have
spring.jpa.hibernate.ddl-auto: update
in application.properties. The value update above will have the schema automatically created on first run and then updated on subsequently. validate instead of update won't alter the schema, but just validate it.
This stackoverflow post lists the possible values and their behaviour.

hibernate ejb3+Tomcat+Openejb or Spring+hibernate for an exsiting GWT2 project

I used GWT2+DAO pattern for my apps and it's work correctly. Now my BD as grown a lot and i want to manage it more easier. So I want to use an ORM.What i want to do is to keep my first DAO implementation and use hibernate for my new classes. But I read a lot on internet and I'm very confused about the way to deal with this.
which solution between hibernate ejb3+Tomcat+Openejb and Spring+hibernate could be better for me?
also which one could be the fastest?
Should I change all my dao to use hibernate methods or should I use the both?
NB: I'm just started to read spring doc, but I have already read hibernate doc.
thanks.
I think the change you need only affects the back-end, hence has nothing to do with the server or container you are using.
Rather in your DAO, when saving new pojos, use hibernateTemplate instead of what you were using.
It would be advisable to actually be consistent, if you are going to use hibernate, use hibernate for all your db manipulation.
Optimization is a whole chapter on itself, I think you should focus on getting your db changes for now, then worry about the speed when everything works.

Embed database in spring project with hibernate

In my previous spring projects, I always use hibernate+postgresql to store the data. I rencently start to use spring-boot, and I am looking for a database system which allow me embed it in my project, without be required the installation of a external DBMS.
I try use SQLite, but in my searches I found some afirmations Hibernate isn't compatible with SQLite.
Anyone knows if this is possible and could point me a solution?
We've successfuly used HSQLDB with Hibernate for ages.
This is actually super cool for sales, you can demonstrate a working application on (potential) customers machine with the embedded HSQLDB database. And still be able to switch to "the real thing" later on.
See also this:
Does Hibernate Fully Support SQLite
and this:
https://code.google.com/p/hibernate-sqlite/

How to generate Model layer, Persistence layer and service layer from a single configuration file

I am using hibernate to persist data on a MySql database.
Now I am already configuring what my business model is in the hibernate configuration file.
What I am looking for is, are there any tools that on building/deploying the application will generate the Model Layer (POJOs), Persistence Layer and the Service Layer (Business logic) for the controllers to communicate with the database server. In short I wish to generated all the basic essentials from a single configuration point.
Ant or Spring or combination of other frameworks, anything that can achieve the solution.
Any reference to an existence thread or a handful document would be highly appreciated.
Thanks in advance.
Your closest bet is Grails.
I'm not a fan of what you'd like to do. Code generation can result in a brittle system.
spring roo can be also good option to look at as your stack is based on spring framework.
Another option which can be used is MyEclipse IDE for Spring this supports code generation based on domain/table.

Resources