i dont open the db.there is some errors like this. Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Fri Oct 29 13:07:32 IST 2021 There was an unexpected error (type=Not Found, status=404).
@Data annotation will add hashcode() and equals() methods along with getter setters etc , usually hashcode equals not required for entity , is there any specific reason?
@@shivaniagrawal8090 but that is not the solution .if you added Lombok dependency did you configure in your IDE if not please do that otherwise add getter and setter method manually in your entity class
I have a problem with the associated entities, I used the method "findRevisions" from interface RevisionRepository, it returns me current entity and null for the associated entitie. can you help me! Thanks
Then in this case it's not possible if you do hard delete . So for that you have to implement soft delete methodology and make updatedBy as who is deleted . In this case you have to maintain history table as well throught trigger.
@@Javatechie got it, spring-data-envers DI of hibernate envers, and have 3 function in it. can u help me create a function to get all history for the revision in the table? i need it for timeline of the data changing
Have u find out? I tried dig more spring data envers in relation onetomany and struggle to get the history data.. but it successfully saved the log data
Java Techie or you can archive the previous record automatically when new records are inserted.. so you can query active records.. minimizing manual work
Hi sir, I implemented the code but if we have 100 fields such as pages. then how can we find the list of the fields changed in 1 revision. as we are getting all the fields with updated in the revision table. but what to do if we just need the field which is changed. thanks
Is there a way to have a single Audit table to keep the updated info from all the table rather having 1 -1 table for audit , i have lots of table and all i care is which field updated by whom , i don't want to have 10 audit table for 10 of my table , it will make the system complex
it looks like this video is not much clear about auditing.. same user can insert and audit?... shouldn't there be a second user who approves the changes and insert into audit tables...
Hi , already I shared one more tutorial regarding auditing , same I mentioned Begin of this video . So to mantain changes , as well as user info then we need to combine both the tutorial
Hi Java Techine, Nice explanation but one thing is missing updatedBy and creadtedby ( who have created/updated/deleted entity). If you update with these it would be great. Thanks, Azhar
In any case, the createdBy field would not be required because the revision includes the type of operation thus you could deduce the createdBy based on updatedBy
No worries I thought it’s your personal code . I am not clear what exactly issue you are having please elaborate it properly so that I can help you out
@@Javatechie sir you directly autowired the repo object in control layer but I need full application like repository layer, service interface, service class and control layer in single application with auditing I need please tell me solution
bravo ... life saving for a programmer
Great video Sir love to see more jaspertreport video Sir 👍
nice bro great Explanation
thq u so much
Hello, thank you for great explanation
nice. Reduced a lot of effort of mine.. Thnks for uploaded.
i dont open the db.there is some errors like this.
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Fri Oct 29 13:07:32 IST 2021
There was an unexpected error (type=Not Found, status=404).
Unable to scan your bean .
Great work
Good content. Simple explanation. Complete understanding. Thanks a lot for your efforts 👍
@Data annotation will add hashcode() and equals() methods along with getter setters etc , usually hashcode equals not required for entity , is there any specific reason?
No data annotation won't include hashcode and equals
Perfect video for beginners...
hi is it possible keep all update values ? like 4 1 - 4 2 and so on? thanks
Not sure I need to check
Thank you so much for the video, but i have one issue tables are not getting generate automatically. could you please share setting to do that
Is your entity table created ?
@@Javatechie i created table manually, it worked perfectly fine, thanks a lot for your video
@@shivaniagrawal8090 but that is not the solution .if you added Lombok dependency did you configure in your IDE if not please do that otherwise add getter and setter method manually in your entity class
I have a problem with the associated entities, I used the method "findRevisions" from interface RevisionRepository, it returns me current entity and null for the associated entitie. can you help me! Thanks
Can you share poc in GitHub so that I can check this out
did u do something ?
Thanks, you save my day 👍
Is it possible to write Audit log with Rolling File handler? I didn't get any reference about it.
I don't think we can do that but will check and update you
Thanks for your reply
After adding @audited notation to classes / entity I am not able to do any post operation
Any error or exception?
is it possible to know which item was actually deleted ?? the example you gave book name is "null" so how we will know which one was exactly deleted ?
Then in this case it's not possible if you do hard delete . So for that you have to implement soft delete methodology and make updatedBy as who is deleted . In this case you have to maintain history table as well throught trigger.
Sir I tried with service layer it's working but findLast .... method not working with response Body but it's working with console why
What if I have one table which is related to 4 tables... Like one to many kind of mapping.. How revision works here
I didn't check but I believe approach is same
Thanks for good explanation and content .can you make video on javers ?
Javers is really cool just now I checked it . definitely I will try this
what is the different of spring-data-envers and hibernate-envers?
Try to find out difference between hibernate and spring data
@@Javatechie got it, spring-data-envers DI of hibernate envers, and have 3 function in it. can u help me create a function to get all history for the revision in the table? i need it for timeline of the data changing
Ok let me check once how can we access revision history data
Have u find out? I tried dig more spring data envers in relation onetomany and struggle to get the history data.. but it successfully saved the log data
Sir atleast can you please print that last method on postman responses body i trying to print but getting 500 error but console like you working
Great. How to recover previous revision?
Your previous revision data you can see in Entity_AUD table , if you want to revert your revision to that then I believe it required manual work
Java Techie or you can archive the previous record automatically when new records are inserted.. so you can query active records.. minimizing manual work
Which tools this one. Its not a eclipse..
Please tell me that
Intellij
Hi sir,
I implemented the code but if we have 100 fields such as pages.
then how can we find the list of the fields changed in 1 revision.
as we are getting all the fields with updated in the revision table.
but what to do if we just need the field which is changed.
thanks
compare the fields from from the previous revisions, using revision_types and recision_timestamps
Can we use this feature for Mongo Repository?🤔🤔
Not sure at this time will check and update
Is there a way to have a single Audit table to keep the updated info from all the table rather having 1 -1 table for audit , i have lots of table and all i care is which field updated by whom , i don't want to have 10 audit table for 10 of my table , it will make the system complex
Audit info should specify to entity so I don't think we can combine them in a single table
Add entity listener and implement ur own version of audit
I'm getting Here an error, that says "unable to read the mapped by attribute". Can please make video on how to solve this issue
how i can use auditing for 2 classes use inheritance concept
it looks like this video is not much clear about auditing.. same user can insert and audit?... shouldn't there be a second user who approves the changes and insert into audit tables...
Hi , already I shared one more tutorial regarding auditing , same I mentioned Begin of this video .
So to mantain changes , as well as user info then we need to combine both the tutorial
what about identity of user who edit those entities
If your application implemented security then you can get the user for each change and map
Nice one 👌 does auditing maintains a seperate table for each entity? If so can we combine any entity class auditing to single table?
Sir I followed every step same but getting false for all hibernate mapping please tell me solution 😢
What is the error you are getting
@@Javatechie false for all hibernate mapping in console showing
How can I find all revisions?
You can't check in history table
Bro please explain orm mapping , one to one, one to many , many to many, many to one , and java 9 features
Okay I will
Thanks sir
Hi Java Techine,
Nice explanation but one thing is missing updatedBy and creadtedby ( who have created/updated/deleted entity). If you update with these it would be great.
Thanks,
Azhar
In any case, the createdBy field would not be required because the revision includes the type of operation thus you could deduce the createdBy based on updatedBy
It is working but if I add service layer means it's not working
Please give me reply sir
Service layer no way link with migration flow. Can you please share your GitHub link
@@Javatechie sorry I am employee recently joined on spring boot designation i can't share my code please do update in your code sir please do it 🙏
No worries I thought it’s your personal code . I am not clear what exactly issue you are having please elaborate it properly so that I can help you out
@@Javatechie sir you directly autowired the repo object in control layer but I need full application like repository layer, service interface, service class and control layer in single application with auditing I need please tell me solution
Do some microservices vides
Will do
source code?
Please check in video description