facebook

Code Generation Hibernate DAO, pojo

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

    ronyosi
    Member

    Hi,

    So far so good. MyEclipse creates the Pojos and the Daos for the database 🙂

    Now, I would like the ID field fo the pojos to automatically generate GUIDvalues for creation of a table entry, but how do I include this in the code generation? I do not want to do it manually each time I regenerate.

    Any help is appreciated I have provided an example below!
    Thanks 🙂

    ie.

    @Id

    @GenericGenerator(name = “generator”, strategy = “guid”, parameters = {})
    @GeneratedValue(generator = “generator”)
    public String getID()
    {
    return ID;
    }

    #314113 Reply

    jkennedy
    Member

    We do not yet support automatically detecting and annotating automatically generated values. In the 9.0 version of ME4S you will be able to use our new JPA Code Assistant to set these values quickly. We will not however have support for automatically generating these values until a future release beyond 9.0. You could consider creating an extension to the code generator (DataType.jet) template if your need warrants making that investment.

    Here is a video that walks you through the basic approach to customizing the code generation templates: http://www.youtube.com/watch?v=LvrUT1Tl0VU

    Thanks,
    Jack

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Code Generation Hibernate DAO, pojo

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