tag:blogger.com,1999:blog-5097100801581543528.post8968117779076998361..comments2024-03-28T21:33:47.476+08:00Comments on krams::: Spring JPA: One-To-Many Association: Using Hibernate as the JPA VendorMark Serranohttp://www.blogger.com/profile/07683739886053674459noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-5097100801581543528.post-23466040901521862302016-09-19T17:30:56.281+08:002016-09-19T17:30:56.281+08:00Interesting Article
Java Online Training from Ind... Interesting Article<br /><br /><a href="http://wisentechnologies.com/it-courses/java-training.aspx" title="Java Online Training from India" rel="nofollow">Java Online Training from India</a> | <a href="http://wisentechnologies.com/it-courses/java-training-course.aspx" title="Core Java Training Online" rel="nofollow">Core Java Training Online</a><br /><br /><a href="http://wisenitsolutions.com/IT-Courses/Java-Training" title="Java Online Training " rel="nofollow">Java Online Training</a> | <a href="http://wisenitsolutions.com/IT-Courses/JavaEE-Training" title="Java EE Online Training" rel="nofollow">Java EE Online Training</a><br /><br /><a href="http://wisentechnologies.com/it-courses/.net-training.aspx" title="Dot Net Online Training" rel="nofollow"> Dot Net Online Training</a> | <a href="http://javascripttrainingcourses.com/JS/Angularjs-Training" title="Angularjs Online Training" rel="nofollow">Angularjs Online Training</a> | <a href="http://javatraininginstitutes.com" title="Java Training Institutes" rel="nofollow">Java Training Institutes</a>navyahttps://www.blogger.com/profile/09650347706574609617noreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-88975863826590830872012-05-30T05:31:26.040+08:002012-05-30T05:31:26.040+08:00Great example! However, when I run it, the 'c...Great example! However, when I run it, the 'credit_card' and 'person' table lose all data at the beginning of the program. When I remove the annotation '@Table(name = 'CREDIT_CARD') on the CreditCard class, these tables do not lose their data. Any idea what's going on? Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-5002670166624323062012-03-07T03:12:00.652+08:002012-03-07T03:12:00.652+08:00I see 2 solutions : one is to store detached objec...I see 2 solutions : one is to store detached object in session and another is to store version number in DTO (though it's not very secure or requires additional checks)Sergei Zaplitnyhttps://www.blogger.com/profile/11786708987623408205noreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-779397538167887852012-03-05T03:52:24.657+08:002012-03-05T03:52:24.657+08:00@krams, not sure if you understand me. I mean in y...@krams, not sure if you understand me. I mean in your example there's transactional 'update' method in service that a) gets object, b) fills its value with updated fields, c) merges it . (I'm also not sure if merge is necessary as updated object is in managed state - not detached). So in the app no conflict occurs if the object was updated before by someone else (and isolation level won't help). We could of course make some sort of locking when edit was started (getEdit called) but it's too bad idea. I have the same architecture and that's why I'm asking you - may be there's standard approach I'm missingSergei Zaplitnyhttps://www.blogger.com/profile/11786708987623408205noreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-66332657732338147982012-03-04T16:05:09.333+08:002012-03-04T16:05:09.333+08:00@Sergei, this is a huge topic. Basically it boils ...@Sergei, this is a huge topic. Basically it boils down to database locking mechanisms and data consistency. See http://en.wikipedia.org/wiki/Lock_(database)<br /><br />In regards to Spring, take a look at various isolation levels for @Transactional annotation. See http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/transaction.html<br /><br />In particular, you might be interested in investigating various ISOLATION levels. See http://static.springsource.org/spring/docs/3.1.x/javadoc-api/Mark Serranohttps://www.blogger.com/profile/07683739886053674459noreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-59578062127961057592012-03-04T06:32:28.564+08:002012-03-04T06:32:28.564+08:00Thanks for great tutorials! I have one problem. I ...Thanks for great tutorials! I have one problem. I thought I find solution here but the problem also exists. How versioning can be done in spring mvc? I mean while user1 edits object another user (user2) can edit the object and update it. User1 will be able to update it without any messages. What's the proper way of solving this problem? Store detached objects in session?Sergei Zaplitnyhttps://www.blogger.com/profile/11786708987623408205noreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-39894411494771286362012-02-16T14:22:40.749+08:002012-02-16T14:22:40.749+08:00That's right. The app is supposed to re-create...That's right. The app is supposed to re-create the tables. That's why the sql script only contains the insert statements.Mark Serranohttps://www.blogger.com/profile/07683739886053674459noreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-28325277222268147422012-02-15T09:36:26.772+08:002012-02-15T09:36:26.772+08:00hi Krams- Thanks for your reply. The mydatabase.sq...hi Krams- Thanks for your reply. The mydatabase.sql contains only insert statements there is no create sqls in it. I downloaded the zip file from the link mentioned here. Would you please check and give me the right link where sqls has it.Thanks ArulArulhttps://www.blogger.com/profile/15461714781594214405noreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-89517285013013236372012-02-13T13:46:52.092+08:002012-02-13T13:46:52.092+08:00@Arul, it can be found under the WEB-INF folder. T...@Arul, it can be found under the WEB-INF folder. The name of the script is mydatabase.sqlMark Serranohttps://www.blogger.com/profile/07683739886053674459noreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-26063600203351460842012-02-13T10:27:51.294+08:002012-02-13T10:27:51.294+08:00hi-could anyone help me where the create SQLs scri...hi-could anyone help me where the create SQLs scripts for the mysql used in the tuitorial I can found. Thanks.Arulhttps://www.blogger.com/profile/15461714781594214405noreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-30937130953604374902012-01-24T10:19:34.897+08:002012-01-24T10:19:34.897+08:00hi-where can I get the sql scripts for creating th...hi-where can I get the sql scripts for creating the tables mentioned in the tuitorial for MySQL? The mentioned file database.sql contains only insert statement. can you please add the DDL also as pert of the zip. Thanks ArulAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-23846075868444549332011-05-19T06:21:57.545+08:002011-05-19T06:21:57.545+08:00Hi Krams, thanks for great tutorials. As I am new ...Hi Krams, thanks for great tutorials. As I am new in learning Hibernate just want to know which one is better Hibernate-based implementation or JPA-based implementaion as in tutorials both looks similarAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5097100801581543528.post-12651317632323776252011-03-29T18:21:16.931+08:002011-03-29T18:21:16.931+08:00Great work. Learned a lot by reading this article....Great work. Learned a lot by reading this article. <br /><br />Thanks<br />GrabczewskiAnonymousnoreply@blogger.com