-
1. Re: Using postgre on Jboss EJB Entity bean
bbbear Jun 22, 2005 1:49 AM (in response to giscard_aioba)I use XDoclet to generate those relevant DD for the entity beans. Have a look at http://xdoclet.sourceforge.net/xdoclet/index.html
Look at @ejb and @jboss tag if you're using JBoss as the app server.
Sample usage will be (at the bean implementation class):
Not all tags needed is in this sample
/**
* @ejb.bean name = "AnEntity"
* type = "CMP"
* display-name = "AnEntity"
* description = "AnEntity EJB"
* view-type = "remote"
* jndi-name = "ejb/AnEntity"
* primkey-field = "id"
*
* @jboss.cmp-field field-name="id" column-name="Id"
* @jboss.cmp-field field-name="column2" column-name="column2"
*
* @jboss.persistence
* datasource="java:/PostgresPool"
* datasource-mapping="PostgreSQL"
* table-name="table_name"
*/
public abstract class AnEntity implements EntityBean {
...
...
}
[Note] The '@jboss.persistence' is where you declared your bean to map to which datasource and table.
Hope this help.
Regards,
bb