12 Replies Latest reply on Jun 3, 2003 3:16 PM by Nigel Birch

    Can getUnderlyingPreparedStatement() be used with CMP? (auto

    Steinar Overbeck Cook Newbie

      I'm trying to figure out the simplest way of auto generating primary keys for my EJB's.

      I know that using DBMS maintained automatic generation of PK's are not portable, but I don't care (I'm not likely to change from Jboss :-))

      So, is there any way I can use the auto_increment feature in mySQL with CMP entity beans? I've read about the getUnderlyingPreparedStatement(), but I can't figure out how to get hold of the connection from my EJB.

      I would rather not use BMP for now, as I'm lazy and want Jboss to do most of the job for me.

      Any other solution (pattern) would also be greatly appreciated.