-
1. Re: mySQL - auto_increment
rafcio Feb 22, 2004 12:31 PM (in response to kkaal)try this:
/**
* ...
*
* @jboss.entity-command
* name = "mysql-get-generated-keys"
*
*/
public abstract class Setting_2_UserBean extends AbstractEntityBean implements EntityBean {
/**
* Gets the setting_2_user_id attribute of the Setting_2_UserBean object
*
* @return The setting_2_user_id value
* @ejb.pk-field
*
* @ejb.persistence
* column-name = "setting_2_user_id"
* sql-type = "setting_2_user_id"
*
* @jboss.persistence
* auto-increment = "true"
*
* @ejb.interface-method
* view-type = "local"
*
*/
public abstract Long getSetting_2_user_id();
/**
* Sets the setting_2_user_id attribute of the Setting_2_UserBean object
*
* @param setting_2_user_id The new setting_id value
*/
public abstract void setSetting_2_user_id(Long setting_2_user_id);
...
}
You have to define
@jboss.entity-command
name = "mysql-get-generated-keys"
on class level.
and
@jboss.persistence
auto-increment = "true"
on method level.
Rafal