GroupBean.java
/* * 创建日期 2005-1-26 * * 作者:javamxj(分享java快乐) */ package javamxj.ejb.cmp; /** * * <!-- begin-user-doc --> You can insert your documentation for '<em><b>GroupBean</b></em>'. <!-- end-user-doc --> * <!-- begin-lomboz-definition --> <?xml version="1.0" encoding="UTF-8"?> <lomboz:EJB xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:lomboz="http://lomboz.objectlearn.com/xml/lomboz"> <lomboz:entity> <lomboz:entityEjb> <j2ee:display-name>Group</j2ee:display-name> <j2ee:ejb-name>Group</j2ee:ejb-name> <j2ee:ejb-class>javamxj.ejb.cmp.GroupBean</j2ee:ejb-class> <j2ee:persistence-type>Container</j2ee:persistence-type> <j2ee:prim-key-class>java.lang.String</j2ee:prim-key-class> <j2ee:cmp-version>2.x</j2ee:cmp-version> <j2ee:abstract-schema-name>GroupSchema</j2ee:abstract-schema-name> <j2ee:primkey-field>name</j2ee:primkey-field> </lomboz:entityEjb> <lomboz:fieldMappings> <lomboz:fieldName>name</lomboz:fieldName> <lomboz:fieldType>java.lang.String</lomboz:fieldType> <lomboz:columnName>名称</lomboz:columnName> <lomboz:jdbcType>VARCHAR</lomboz:jdbcType> <lomboz:sqlType>varchar</lomboz:sqlType> <lomboz:readOnly>false</lomboz:readOnly> <lomboz:primaryKey>true</lomboz:primaryKey> </lomboz:fieldMappings> <lomboz:fieldMappings> <lomboz:fieldName>description</lomboz:fieldName> <lomboz:fieldType>java.lang.String</lomboz:fieldType> <lomboz:columnName>行业说明</lomboz:columnName> <lomboz:jdbcType>VARCHAR</lomboz:jdbcType> <lomboz:sqlType>varchar</lomboz:sqlType> <lomboz:readOnly>false</lomboz:readOnly> <lomboz:primaryKey>false</lomboz:primaryKey> </lomboz:fieldMappings> <lomboz:tableName>GroupTable</lomboz:tableName> <lomboz:dataSourceName></lomboz:dataSourceName> </lomboz:entity> </lomboz:EJB> <!-- end-lomboz-definition --> * * <!-- begin-xdoclet-definition --> * @ejb.bean name="Group" * jndi-name="Group" * type="CMP" * primkey-field="name" * schema="GroupSchema" * cmp-version="2.x" * view-type = "local" * data-source="" * * @ejb.persistence * table-name="GroupTable" * * * * @ejb.finder * query="SELECT OBJECT(a) FROM GroupSchema as a" * signature="java.util.Collection findAll()" * * @ejb.pk class="java.lang.String" * <!-- end-xdoclet-definition --> * @generated **/ public abstract class GroupBean implements javax.ejb.EntityBean { /** * @ejb.create-method */ public java.lang.String ejbCreate(String name, String description) throws javax.ejb.CreateException { // EJB 2.0 spec says return null for CMP ejbCreate methods. setName(name); setDescription(description); return null; } /** * The container invokes this method immediately after it calls ejbCreate. */ public void ejbPostCreate(String name, String description) throws javax.ejb.CreateException { } /** * CMP Field name * @return the name * @ejb.persistent-field * @ejb.persistence * column-name="名称" * jdbc-type="VARCHAR" * sql-type="varchar(24)" * read-only="false" * @ejb.pk-field * * @ejb.interface-method */ public abstract java.lang.String getName(); /** * @param java.lang.String the new name value * @ejb.interface-method */ public abstract void setName(java.lang.String name); /** * CMP Field description * @return the description * @ejb.persistent-field * @ejb.persistence * column-name="行业说明" * jdbc-type="VARCHAR" * sql-type="varchar(24)" * read-only="false" * * * @ejb.interface-method */ public abstract java.lang.String getDescription(); /** * @param java.lang.String the new description value * @ejb.interface-method */ public abstract void setDescription(java.lang.String description); //######################## Select method ############################## /** * Select method * @ejb.select * query = "SELECT user.email FROM GroupSchema AS g, IN (g.users) AS user WHERE g.name = ?1" * */ public abstract java.util.Collection ejbSelectUserIDs(String groupName) throws javax.ejb.FinderException; /** * Home method * @throws FinderException * @ejb.home-method view-type = "local" */ public java.util.ArrayList ejbHomeGetUserIDs(String groupName) throws javax.ejb.FinderException { return (java.util.ArrayList) ejbSelectUserIDs(groupName); } // ######################## CMR Relationship ############################## /** * Getter for CMR Relationship * * @ejb.interface-method view-type="local" * @ejb.relation name = "GroupsHaveUserInfos" * role-name = "GroupHasUserInfos" * target-multiple = "no" */ public abstract java.util.Collection getUsers(); /** * Setter for CMR Relationship * * @ejb.interface-method view-type="local" */ public abstract void setUsers(java.util.Collection value); }
本文地址:http://com.8s8s.com/it/it11649.htm