An example of a changed template (HibernateEntity.vsl):

.
.
.
#if ($attribute.identifier)
    * @hibernate.id 
##walter    *     generator-class="uuid.hex"
#if($atttypename == "java.lang.String")
    *     generator-class="assigned"
#else
    *     generator-class="native"
    * @hibernate.generator-param
    *     name="sequence"
    *     value="SEQ_${tableNamePrefix}${entity.tableName}" 
#end
#else
    * @hibernate.property
#end
    *     column="$attribute.columnName"
    *     type="$attribute.type.fullyQualifiedHibernateType"
    *
    * @hibernate.column
     *     name="$attribute.columnName"
     *     sql-type="$attribute.sqlType"
.
.
.

Good luck,

Walter

AndreasWuest <[EMAIL PROTECTED]> writes:
>Hello,
>
>i was wondering how i can configure the name of the sequence that
>is to be used for id generation. Writing the classes and the
>hibernate tags myself i use the following hibernate tags in my code
>
>
>  /*
>   * @hibernate.id  generator-class="sequence"
>   * @hibernate.generator-param name="sequence" value="id_seq"
>   */
>  public Long getId() {
>    return id;
>  }
>
>how and where do i have to add the name of the sequence ("id_seq")
>so that the hibernate tags will be created properly? So far i only
>succeeded in changing the generator class, but i have no idea how
>to set the sequence name. did i overlook some documentation ?
>what i got so far by adding the
>idGeneratorClass tag (<idGeneratorClass>sequence</idGeneratorClass>)
>to my project.xml is the following :
>
>    /*
>     * @hibernate.id
>     *     generator-class="sequence"
>     *     column="ID"
>     *     type="java.lang.Long"
>     *
>     * @hibernate.column
>     *     name="ID"
>     *     sql-type="java.lang.Long"
>     *     not-null="true"
>     */
>
>
>How can i set and where do i have to set the name of the sequence
>that is to be used ??
>
>I am using andromda 3.0M3.
>
>Thx in advance,
>Andreas
>
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>_______________________________________________
>Andromda-user mailing list
>Andromda-user@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/andromda-user




---------------------------------------------------------------------------
Walter Itamar Mourão - Diretor de Tecnologia e Projetos - Arcadian S/A
www.arcadian.com.br



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to