We are using PostgreSQL as our database and use the SERIAL data type (INT4 with an automatic sequence number) to generate primary keys for all of our tables. So, all of our Entity beans has a consistent "id" field as the primary key. So, the type is java.lang.Integer.
Here is an example:
/**
* IncentiveHome is the Home interface for the Incentive EJB
*/
public interface IncentiveHome extends EJBHome {
/**
* Standard EJB findByPrimaryKey
*/
public Incentive findByPrimaryKey(Integer id) throws RemoteException, FinderException;
/**
* Standard EJB create method to create a new incentive
*/
public Incentive create() throws RemoteException, CreateException;
}
Here is the descriptor:
<entity>
</entity>
and the jonas descriptor:
<jonas-entity>
<ejb-name>Incentive</ejb-name>
<jndi-name>com.im.ejb.Incentive</jndi-name>
<jdbc-mapping>
<jndi-name>jdbc_1</jndi-name>
<jdbc-table-name>incentive</jdbc-table-name>
<cmp-field-jdbc-mapping>
</jdbc-mapping>
</jonas-entity>
Regards,
-Bill.
At 08:55 PM 8/24/00 +0200, Thomas Gr�nert wrote:
Hi,
is there any chance to use Long or String as PK without a extra PK-Class ?
Please give me an example or a source from the bean and the descriptor.
I can�t find any example of that in documentation, books, websites and so one.
Thanx
Thomas Gr�nert
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".
Bill Bunting, CTO
IncentiveMeetings.com, LLC
email: [EMAIL PROTECTED]
Web: http://www.incentiveMeetings.com
