Hi Alex,

first of all thanx for your fast reply :)
most likely i have to work with jboss during my diploma thesis and so i
started to work with it. since version 3.2 it was very deterrent to 
me that jboss was not able to handle automated pk generation (except for
an extra bean handling the pk). then i had trouble with xdoclet
(dev-version), poor time and so on. short: my jboss project falls
asleep.
a few days ago i started with jboss3.2.0RC2 (now R3) and xdoclet 1.2b3
on the template based on jboss3.0.x from andreas achaefer. i took the
"TestEntityBean" and try to adopt it to the new version (including
primary key generation). i need this, to show people at university how
to start with jboss :)
if my template i ready i'll publish it, certainly! 

> - no cmp accessors for the unknown pk field;
> - ejbCreate declares java.lang.Object as a return type
> - ejbFindByPrimaryKey takes java.lang.Object as a parameter
> - in ejb-jar.xml <prim-key-class>java.lang.Object</prim-key-class>
> - no primkey-field in ejb-jar.xml
> 
> It seems to me that's all. I assume XDoclet generates correct
> jbosscmp-jdbc.xml.
> The SQL in your example is not safe. There meant to be some statement
> that fetches next sequence value.
i know, but i wasn't sure of the hsqldb supports sequences (and i have
no idea how to create it automaticly, sql-type="SERIAL"?)...
i a second step i'll work with postgres which supports sequences... 

thanx
markus

> 
> MG> i included the following lines into my entity bean:
> MG> ...
> MG>  * @jboss.unknown-pk
> MG>  *    class="java.lang.Integer"
> MG>  *    column-name="id"
> MG>  *    jdbc-type="INTEGER"
> MG>  *    sql-type="INTEGER"
> MG>  * @jboss.entity-command
> MG>  *    name="pk-sql"
> MG>  * @jboss.entity-command-attribute
> MG>  *    name="pk-sql"
> MG>  *    value="SELECT max(id)+1 FROM TestEntity"
> MG> ...
> 
-- 
-------------------------------------------------------------------------------
 Markus Garscha                    
 Germany                                                  pgp-keyid: 0xEE18AF3B  
-------------------------------------------------------------------------------

Attachment: msg26347/pgp00000.pgp
Description: PGP signature

Reply via email to