This content has been marked as final.
Show 1 reply
-
1. PostgreSQL + auto-increment + SERIAL + xdoclet
gavin9 May 13, 2004 9:32 PM (in response to gavin9)my problem was in fact using the "Version 3.0" instead of "Version 3.2" in the xdoclet configuration. My bad.
Anyways after wrestling with auto-increment and postgresql I will post my source here, because there are far too few examples to be found./* * Created on 13/05/2004 */ package com.wt.helpdesk.ejb; import java.rmi.*; import javax.ejb.*; /** * @author glang * * @ejb.bean * name = "JobTicket" * display-name = "JobTicket" * view-type = "local" * type = "CMP" * cmp-version = "2.x" * local-jndi-name = "helpdesk/JobTicket" * reentrant = "false" * schema = "JobTicket" * @ejb.pk * class = "java.lang.Object" * * @jboss.persistence * remove-table = "true" * table-name = "JobTicket" * @jboss.unknown-pk * class = "java.lang.Integer" * column-name = "ID" * jdbc-type = "INTEGER" * sql-type = "SERIAL" * auto-increment = "true" * @jboss.entity-command * name = "postgresql-fetch-seq" */ public abstract class JobTicket implements EntityBean { /** * @ejb.create-method * @ejb.interface-method */ public Object ejbCreate(String summary) throws CreateException { setSummary(summary); return null; } /** * @ejb.persistence * column-name = "SUMMARY" * jdbc-type = "VARCHAR" * sql-type = "varchar(50)" * @ejb.interface-method */ public abstract String getSummary(); /** * @ejb.interface-method */ public abstract void setSummary(String desc); public void ejbActivate() throws EJBException, RemoteException {} public void ejbLoad() throws EJBException, RemoteException {} public void ejbPassivate() throws EJBException, RemoteException {} public void ejbRemove() throws RemoveException, EJBException, RemoteException {} public void ejbStore() throws EJBException, RemoteException {} public void setEntityContext(EntityContext arg0) throws EJBException, RemoteException {} public void unsetEntityContext() throws EJBException, RemoteException {} }