Hello Markus,
it does work! ;)
Do you have <prim-key-class>java.lang.Object</prim-key-class> in
ejb-jar.xml?
MG> i have no ejbFindByPrimaryKey defined...
Sorry, for confusion. I meant findByPrimaryKey in home interface. It
should take Object as a parameter.
alex
Friday, February 21, 2003, 7:27:00 PM, Markus Garscha wrote:
MG> It doesn't work!
MG> i still can't autocreate the table. my database receives the following
MG> sql statement:
MG> CREATE TABLE testentity (First_Name TEXT, Last_Name TEXT, CONSTRAINT
MG> pk_testentity PRIMARY KEY ())
MG> there is no PK!!!
MG> my jbosscmp-jdbc.xml looks like
MG> ...
MG> <unknown-pk>
MG> <unknown-pk-class>java.lang.Integer</unknown-pk-class>
MG> <column-name>id</column-name>
MG> <jdbc-type>INTEGER</jdbc-type>
MG> <sql-type>INTEGER</sql-type>
MG> </unknown-pk>
MG> <entity-command name="pk-sql">
MG> <attribute name="pk-sql">SELECT max(id)+1 FROM
TestEntity</attribute>
MG> </entity-command>
MG> ...
MG> i have no <cmp-field>..</cmp-field> descriptors in jbosscmp-jdbc.xml and
MG> no getId()/setId(..) in my bean.
MG> my ejbCreate() looks like
MG> public java.lang.Object ejbCreate() throws CreateException {
MG> return null;
MG> }
MG> i have no ejbFindByPrimaryKey defined...
MG> greetings
MG> markus
MG> * Alex Loubyansky <[EMAIL PROTECTED]> [2003-02-20 08:00]:
>> Markus,
>>
>> first of all, check Unknown primary key paragraph in the spec if you
>> didn't yet.
>> In a short:
>> - 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.
>>
>> HTH,
>> alex
>>
>> Wednesday, February 19, 2003, 8:19:03 PM, you wrote:
>>
>> MG> Hi,
>>
>> MG> i haven't managed to use the auto generating primary key of jboss 3.2.x
>> MG> and xdoclet 1.2b3!
>> MG> is there any example of _one_ simple ejb out there? i can't find
>> MG> anything on google!
>>
>> 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> ...
>>
>> MG> what to write in ejbCreate()? better: how to handle the creation
>> MG> process? any links, ideas suggestions?
>>
>> MG> thanx a lot
>> MG> markus
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user