- This topic has 8 replies, 6 voices, and was last updated 15 years, 6 months ago by
Brian Fernandes.
-
AuthorPosts
-
exlipzSnx7MemberHi… This tool generate classes from DB tables and thanks God it exist… But it seem to generate save/delete/findby.. methods with getSession calls not getHibernateTempate calls… I read that getHibernateTemplate method handles transactions/callbacks/exceptions with ease … Is the a tool for this?
Oh also, noted that update methods are not generated from DB … only the three above with many findby methods
Lastly, what’s the difference between getHibernateTemplate().loadall() and the findall() generated by this tool?
November 3, 2008 at 11:59 am #290593
Riyad KallaMemberexlipzSnx7,
If you add both Spring and Hibernate capabilities to the project, MyEclipse will recognize it as a joint Spring-Hibernate project and utilize the Spring Template in the rev-eng process, it also should generate an update and merge method typically for begining detached objects back into the session.
Can you do me a favor and create a new Web Project, add Spring then hibernate to it, then rev-eng the MyEclipse Derby “CLASSICCARS” schema tables… maybe just EMPLOYEE table or something, and see if everything looks kosher?
November 4, 2008 at 2:11 am #290617
exlipzSnx7Member@support-rkalla wrote:
exlipzSnx7,
If you add both Spring and Hibernate capabilities to the project, MyEclipse will recognize it as a joint Spring-Hibernate project and utilize the Spring Template in the rev-eng process, it also should generate an update and merge method typically for begining detached objects back into the session.
Can you do me a favor and create a new Web Project, add Spring then hibernate to it, then rev-eng the MyEclipse Derby “CLASSICCARS” schema tables… maybe just EMPLOYEE table or something, and see if everything looks kosher?
Thanks a lot 🙂
November 4, 2008 at 3:55 am #290619
exlipzSnx7Member@support-rkalla wrote:
exlipzSnx7,
If you add both Spring and Hibernate capabilities to the project, MyEclipse will recognize it as a joint Spring-Hibernate project and utilize the Spring Template in the rev-eng process, it also should generate an update and merge method typically for begining detached objects back into the session.
Can you do me a favor and create a new Web Project, add Spring then hibernate to it, then rev-eng the MyEclipse Derby “CLASSICCARS” schema tables… maybe just EMPLOYEE table or something, and see if everything looks kosher?
Oh! two questions
1. What does the merge function do
2. Why is getHibernateTamplate().update() not generated?
3. Lastly, there seems to be plenty more findby methods which return a List.. Is this List of my persistent object? I mean is the relusts same to findall() which also return a list of objectsThnx
November 11, 2008 at 3:35 pm #290868
Riyad KallaMember1. Merge pulls an out-of-session object back under the management of the newest hibernate session. So for example, if you are passing an object, say User, around the interface through a wizard flow, and then want to save it out as the last step, you cannot just call “save” because it already exists in the database, and you cannot just call “update” because Hibernate has no knowledge of this object, so you call merge to merge it back into the session and then you can save/update it.
2. In a Hibernate/Spring joint project it will, you also have to make sure to generate Spring DAOs during the rev-eng process, please check the attached screenshots.
3. Yes, it’s a list of your entities, like a List of Employees. findAll returns every instance, findBy returns only the ones matching the terms you pass in.
Attachments:
You must be logged in to view attached files.March 15, 2009 at 1:07 pm #296065
sridhar1985MemberHi,
I am new to Hibernate and Myeclipse. I am using myeclipse 7.
i want to get mapping hibernate files for my database tables. By using Hibernate revrse engineering i can get. But can i get the mapping files for all tables in one shot instead right click on each and every table.I want to call and run Database procedure or function from Hibernate. How can i do it in myeclipse.
Please help me out. Thanks in advance.
Sridhar.
March 25, 2009 at 1:20 pm #296753
Loyal WaterMemberYes absolutely, in the DB Explorer when you go to rev-eng your tables, use Shift-Click or CTRL-Click to select all the tables you want to rev-eng, then right-click on the list and do the reverse engineering, all the tables will be done at once.
December 21, 2009 at 4:37 pm #304909This message has not been recovered.
December 24, 2009 at 1:17 am #304963
Brian FernandesModeratorThis message has not been recovered.
-
AuthorPosts