Ionel GARDAIS wrote:
Plenty of errors or otherwise wrong/deprecated tag usages. Let's go through some of them...Here is one of my typical file :
* @ejb:home> local-class="org.TechAdvantage.intranet.ejb.cmp.SalleLocal"
* generate="local"
* local-class="org.TechAdvantage.intranet.ejb.cmp.SalleLocalHome"
*
* @ejb:interface
* generate="local"
*
You don't need these, as you're generating into the same package as the current bean. Don't hurt to have them, however.
Take a look at the @jboss.persistence and @ejb.persistence tags. It's the preferred way to specify these properties. All these tags will be deprecated.* @jboss:read-only * read-only="true" * * @jboss:table-name * table-name="Salle" * * @jboss:create-table * create="false" * * @jboss:remove-table * remove="false"
/**
* @ejb.persistence
* table-name="Salle"
* @jboss.persistence
* read-only="true"
* create-table="false"
* remove-table="false"
*/
@jboss.cmp-field is just to add fields that don't have getters declared in the current bean. To be sincere, I've never used it and I doubt someone has real need of it. You don't need it. You just need to mark each field getter with @ejb.persistence, this way:* @jboss:cmp-field * field-name="id" * column-name="IdSalle"
/**
* @ejb.interface-method
* view-type="local"
* @ejb.persistence
* column-name="IdSalle"
* jdbc-type="INTEGER"
* sql-type="SMALLINT(5)"
*/
public abstract Integer getId();
The same for the other fields, and remove these @jboss.cmp-field tags.
/**
* @ejb.pk-field
* @ejb.value-object
* match="*"
* @ejb.interface-method
* @ejb:persistent-field
* @jboss:sql-type SMALLINT(5)
*/
public abstract Integer getId();
@ejb.persistent-field and @jboss.sql-type are deprecated. Also, whenever
you specify sql-type, you should also specify jdbc-type. See the
previous comment for example.Also, use @ejb.pk-field only if you want XDoclet to generate a PK class for you. If all you want is to use the id field as the primkey-field for you bean, add @ejb.primkey-field="id" at class level.
And oh, remember you MUST declare setId(Integer id) even if you don't use it in the remote interface. Just don't add @ejb.interface-method to it (pk fields shouldn't have setters exposed, but they must be declared).
Lastly: look at the samples. They may be somewhat outdated, but are mostly a good example to follow. Also, you may want to take a look at the xPetStore project, a fully working version of the infamous Sun Petstore using xdoclet everywhere possible: http://xpetstore.sf.net
--
Pazu <[EMAIL PROTECTED]>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user
