Duncan,

If you are using CMP, or entity beans in general, just for the speed of
development, then you are probably misusing entity beans.   If I were you, I
would check out Castor (www.castor.org).   It allows the same speed of
development, but without all of the overhead that you encounter with entity
beans.   Castor will also handle your IDENTITY problem.

Adam

-----Original Message-----
From: Duncan Godwin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 13, 2001 9:19 AM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] IDENTITY Fields and CMP


Hi, 

I am fairly new to EJB's and I want to use CMP for the speed of development
as the majority of tables are quite simple. There is one problem however the
database (SQL Server) have an IDENTITY column as a primary key. This means
CMP cannot create the object properly as it doesn't have the primary key for
ejbCreate. 

So, what if all accessors, find methods etc. were implemented as CMP, but I
write a sort of Factory stateless session bean that can create manually
using JDBC. The advantage being that most of the logic is already working
with the exception of the create method. The stateless session bean could
even call findByPrimaryKey on the beans home interface and return a remote
reference to the newly created entity bean. 

Is this workable? Comments and suggestions as to another way are welcome. 

Regards,

Duncan
___________________________________________________________________________
Visit http://www.visto.com.
Find out  how companies are linking mobile users to the 
enterprise with Visto.


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to