facebook

HIbernate Reverse Engineering tool

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #290501 Reply

    exlipzSnx7
    Member

    Hi… 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?

    #290593 Reply

    Riyad Kalla
    Member

    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?

    #290617 Reply

    exlipzSnx7
    Member

    @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 🙂

    #290619 Reply

    exlipzSnx7
    Member

    @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 objects

    Thnx

    #290868 Reply

    Riyad Kalla
    Member

    1. 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.
    #296065 Reply

    sridhar1985
    Member

    Hi,

    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.

    #296753 Reply

    Loyal Water
    Member

    Yes 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.

    #304909 Reply

    lhale
    Participant

    This message has not been recovered.

    #304963 Reply

    Brian Fernandes
    Moderator

    This message has not been recovered.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: HIbernate Reverse Engineering tool

You must be logged in to post in the forum log in