package.jdo

if id is not needed as a number in the application

<class name=”Author” table=”MERIT_AUTHOR”>
<datastore-identity strategy=”sequence” sequence=”AUTHOR_ID_SEQ” column=”AUTHOR_ID”/>
<field name=”firstName”>
<column name=”FIRSTNAME”/>
</field>
<field name=”lastName”>
<column name=”LASTNAME”/>
</field>
<field name=”userName”>
<column name=”USERNAME”/>
</field>
<field name=”posts” mapped-by=”author”>
<collection element-type=”entity.Post”/>
</field>
</class>

 

to use the id

<sequence name=”WEBSESSION_ID_SEQ” datastore-sequence=”MERIT_WEBSESSION_SEQ” strategy=”noncontiguous” allocation-size=”1″ initial-value=”1″/>
<class name=”WebSession”>
<field name=”id” primary-key=”true” value-strategy=”sequence” sequence=”WEBSESSION_ID_SEQ”/>
</class>