It doesn't work!

i still can't autocreate the table. my database receives the following
sql statement:

CREATE TABLE testentity (First_Name TEXT, Last_Name TEXT, CONSTRAINT
pk_testentity PRIMARY KEY ())

there is no PK!!!

my jbosscmp-jdbc.xml looks like
...
        <unknown-pk>
                <unknown-pk-class>java.lang.Integer</unknown-pk-class>
                <column-name>id</column-name>
                <jdbc-type>INTEGER</jdbc-type>
                <sql-type>INTEGER</sql-type>
        </unknown-pk>
        <entity-command name="pk-sql">
                <attribute name="pk-sql">SELECT max(id)+1 FROM TestEntity</attribute>
        </entity-command>
...

i have no <cmp-field>..</cmp-field> descriptors in jbosscmp-jdbc.xml and
no getId()/setId(..) in my bean.

my ejbCreate() looks like

public java.lang.Object ejbCreate() throws CreateException {
  return null;
}

i have no ejbFindByPrimaryKey defined...

greetings
markus

* 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

-- 
-------------------------------------------------------------------------------
 Markus Garscha                    
 Germany                                                  pgp-keyid: 0xEE18AF3B  
-------------------------------------------------------------------------------

Attachment: msg26401/pgp00000.pgp
Description: PGP signature

Reply via email to