|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.ispsoft.jaxme.generator.beanwriter.EntityBeanClassWriter
Used by the BeanWriter to generate entity beans.
Field Summary | |
protected SchemaComplexElement |
element
|
protected static org.xml.sax.Attributes |
emptyAttributes
|
protected static SourceWriterImpl |
sourceWriter
|
Constructor Summary | |
EntityBeanClassWriter(SourceWriterImpl pSourceWriter,
SchemaComplexElement pElement)
Creates a new instance of EntityBeanWriter |
Method Summary | |
JavaSource |
generateBean()
Generates the bean class. |
protected JavaMethod |
generateBeanClassInitializer(JavaSource js)
Generates the bean classes class constructor. |
protected JavaField |
generateContextField(JavaSource js)
Generates the context field. |
protected JavaMethod |
generateCreateMethod(JavaSource js)
Generates the create() method. |
protected JavaMethod |
generateEjbActivateMethod(JavaSource js)
Generates the ejbActivate() method. |
protected JavaMethod |
generateEjbLoadMethod(JavaSource js)
Generates the ejbLoad() method. |
protected JavaMethod |
generateEjbPassivateMethod(JavaSource js)
Generates the ejbPassivate() method. |
protected JavaMethod |
generateEjbPostCreateMethod(JavaSource js)
Generates the ejbPostCreate() method. |
protected JavaMethod |
generateEjbRemoveMethod(JavaSource js)
Generates the ejbRemove() method. |
protected JavaMethod |
generateEjbStoreMethod(JavaSource js)
Generates the ejbStore() method. |
protected JavaField |
generateElementField(JavaSource js)
Generates the element field. |
protected JavaMethod |
generateFindByPrimaryKeyMethod(JavaSource js)
Generates the findByPrimaryKey() method. |
protected JavaMethod |
generateFindByQueryFourArgsMethod(JavaSource js)
Generates the findByQuery() method with four arguments. |
protected JavaMethod |
generateFindByQueryOneArgMethod(JavaSource js)
Generates the findByQuery() method with one argument. |
protected JavaMethod |
generateFindByQueryThreeArgsMethod(JavaSource js)
Generates the findByQuery() method with three arguments. |
protected JavaMethod |
generateFindByQueryTwoArgsMethod(JavaSource js)
Generates the findByQuery() method with two arguments. |
protected JavaMethod |
generateGetXMLMethod(JavaSource js)
Generates the getXML() method. |
JavaSource |
generateHome()
Generates the beans home interface. |
protected JavaMethod |
generateIsModifiedMethod(JavaSource js)
Generates the isModified() method. |
JavaSource |
generatePrimaryKey()
Generates the primary key class. |
protected java.lang.String |
generatePrimaryKeyEquals(java.lang.String pVar,
java.lang.String pArg)
Generates a test for equality for update(). |
protected java.lang.String |
generatePrimaryKeyQuery(java.lang.String pArg)
Generates a query for a primary key for findByPrimaryKey. |
protected java.lang.String |
generatePrimaryKeyQueryPlaceHolders(java.lang.String pArg)
Generates a placeholder list for findByPrimaryKey. |
protected java.lang.String |
generatePrimaryKeyResult(java.lang.String pArg)
Generates a result for findByPrimaryKey. |
protected java.lang.String |
generatePrimaryKeyToString(java.lang.String arg)
Generates a description of the primary key for use in error messages. |
JavaSource |
generateRemote()
Generates the beans remote interface. |
protected JavaMethod |
generateSetContextMethod(JavaSource js)
Generates the setEntityContext() method. |
protected JavaMethod |
generateUnsetContextMethod(JavaSource js)
Generates the unsetEntityContext() method. |
protected JavaMethod |
generateUpdateMethod(JavaSource js)
Generates the update() method. |
protected java.lang.String |
getBeanClassName()
Returns the name of the generated bean class. |
protected java.lang.String[] |
getBeanImplementsClass()
Generates the interface, that the bean class implements. |
protected JdbcListMethod[] |
getBeanListMethods()
|
protected java.lang.String |
getBeanName()
Returns the beans name for resource references. |
protected java.lang.String |
getDataSourceName()
Returns the beans datasource name. |
protected java.lang.String |
getDeclaredBeanClassName()
Returns the name of the declared bean class. |
protected java.lang.String |
getDeclaredHomeClassName()
Returns the name of the declared home interface. |
protected java.lang.String |
getDeclaredPrimaryKeyClassName()
Returns the name of the declared primary key class. |
protected java.lang.String |
getDeclaredRemoteClassName()
Returns the name of the declared remote interface. |
protected java.lang.String |
getEJBException(java.lang.String pMsg,
java.lang.String pException)
Creates a piece of JavaSource throwing an EJBException that encapsulates another Exception. |
protected java.lang.String |
getHomeClassName()
Returns the name of the generated home interface. |
protected JdbcListMethod[] |
getHomeListMethods()
|
protected boolean |
getImplDeclaresRemoteException()
Used to determine whether generated implementations should declare a RemoteException or not. |
protected java.util.List |
getKeyList()
Generates a list of all parts of the primary key. |
protected java.util.List |
getKeyList(boolean pAllowZeroSize)
|
protected JavaMethod |
getListMethod(JavaSource pJs,
JdbcListMethod pMethod)
|
protected java.lang.String |
getPrimaryKeyClassName()
Returns the primary key class. |
protected java.lang.String |
getRemoteClassName()
Returns the name of the generated remote interface. |
protected JdbcListMethod[] |
getRemoteListMethods()
|
void |
writeContainerTransactionDeclaration(org.xml.sax.ContentHandler pHandler)
Writes a method declaration in the ejb-jar file. |
void |
writeEntityDeclaration(org.xml.sax.ContentHandler pHandler)
Writes an entity bean declaration in the ejb-jar file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SchemaComplexElement element
protected static org.xml.sax.Attributes emptyAttributes
protected static SourceWriterImpl sourceWriter
Constructor Detail |
public EntityBeanClassWriter(SourceWriterImpl pSourceWriter, SchemaComplexElement pElement)
Method Detail |
protected java.lang.String getEJBException(java.lang.String pMsg, java.lang.String pException)
Creates a piece of JavaSource throwing an EJBException
that encapsulates another Exception. Reason is that
new EJBException(msg, e)
is available since EJB 2.0
only.
protected boolean getImplDeclaresRemoteException()
Used to determine whether generated implementations should declare a RemoteException or not.
protected java.lang.String getBeanName()
Returns the beans name for resource references.
protected JavaMethod generateCreateMethod(JavaSource js)
Generates the create() method.
protected JavaMethod generateEjbPostCreateMethod(JavaSource js)
Generates the ejbPostCreate() method.
protected JavaMethod generateFindByPrimaryKeyMethod(JavaSource js)
Generates the findByPrimaryKey() method.
protected JavaMethod generateFindByQueryOneArgMethod(JavaSource js)
Generates the findByQuery() method with one argument.
protected JavaMethod generateFindByQueryTwoArgsMethod(JavaSource js)
Generates the findByQuery() method with two arguments.
protected JavaMethod generateFindByQueryThreeArgsMethod(JavaSource js)
Generates the findByQuery() method with three arguments.
protected JavaMethod generateFindByQueryFourArgsMethod(JavaSource js)
Generates the findByQuery() method with four arguments.
public JavaSource generateHome() throws SchemaException
Generates the beans home interface.
generateHome
in interface BeanClassWriter
SchemaException
protected JavaMethod generateGetXMLMethod(JavaSource js)
Generates the getXML() method.
protected JavaMethod generateUpdateMethod(JavaSource js)
Generates the update() method.
public JavaSource generateRemote() throws SchemaException
Generates the beans remote interface.
generateRemote
in interface BeanClassWriter
SchemaException
protected JavaMethod generateBeanClassInitializer(JavaSource js)
Generates the bean classes class constructor.
protected JavaMethod generateEjbStoreMethod(JavaSource js)
Generates the ejbStore() method.
protected JavaMethod generateEjbLoadMethod(JavaSource js)
Generates the ejbLoad() method.
protected JavaMethod generateEjbActivateMethod(JavaSource js)
Generates the ejbActivate() method.
protected JavaMethod generateEjbPassivateMethod(JavaSource js)
Generates the ejbPassivate() method.
protected JavaMethod generateEjbRemoveMethod(JavaSource js)
Generates the ejbRemove() method.
protected JavaMethod generateSetContextMethod(JavaSource js)
Generates the setEntityContext() method.
protected JavaMethod generateUnsetContextMethod(JavaSource js)
Generates the unsetEntityContext() method.
protected JavaMethod generateIsModifiedMethod(JavaSource js)
Generates the isModified() method.
protected JavaField generateContextField(JavaSource js)
Generates the context field.
protected JavaField generateElementField(JavaSource js)
Generates the element field.
protected java.lang.String[] getBeanImplementsClass()
Generates the interface, that the bean class implements.
public JavaSource generateBean() throws SchemaException
Generates the bean class.
generateBean
in interface BeanClassWriter
SchemaException
public JavaSource generatePrimaryKey()
Generates the primary key class.
generatePrimaryKey
in interface BeanClassWriter
public void writeEntityDeclaration(org.xml.sax.ContentHandler pHandler) throws org.xml.sax.SAXException
Writes an entity bean declaration in the ejb-jar file.
writeEntityDeclaration
in interface BeanClassWriter
org.xml.sax.SAXException
public void writeContainerTransactionDeclaration(org.xml.sax.ContentHandler pHandler) throws org.xml.sax.SAXException
Writes a method declaration in the ejb-jar file.
writeContainerTransactionDeclaration
in interface BeanClassWriter
org.xml.sax.SAXException
protected java.util.List getKeyList()
Generates a list of all parts of the primary key.
protected java.util.List getKeyList(boolean pAllowZeroSize)
protected java.lang.String generatePrimaryKeyToString(java.lang.String arg)
Generates a description of the primary key for use in error messages.
protected java.lang.String generatePrimaryKeyQuery(java.lang.String pArg)
Generates a query for a primary key for findByPrimaryKey.
protected java.lang.String generatePrimaryKeyQueryPlaceHolders(java.lang.String pArg)
Generates a placeholder list for findByPrimaryKey.
protected java.lang.String generatePrimaryKeyResult(java.lang.String pArg)
Generates a result for findByPrimaryKey.
protected java.lang.String generatePrimaryKeyEquals(java.lang.String pVar, java.lang.String pArg)
Generates a test for equality for update().
protected java.lang.String getPrimaryKeyClassName()
Returns the primary key class.
protected java.lang.String getDataSourceName()
Returns the beans datasource name.
protected java.lang.String getBeanClassName()
Returns the name of the generated bean class.
protected java.lang.String getHomeClassName()
Returns the name of the generated home interface.
protected java.lang.String getRemoteClassName()
Returns the name of the generated remote interface.
protected java.lang.String getDeclaredRemoteClassName()
Returns the name of the declared remote interface.
protected java.lang.String getDeclaredHomeClassName()
Returns the name of the declared home interface.
protected java.lang.String getDeclaredBeanClassName()
Returns the name of the declared bean class.
protected java.lang.String getDeclaredPrimaryKeyClassName()
Returns the name of the declared primary key class.
protected JdbcListMethod[] getHomeListMethods()
protected JdbcListMethod[] getRemoteListMethods()
protected JdbcListMethod[] getBeanListMethods()
protected JavaMethod getListMethod(JavaSource pJs, JdbcListMethod pMethod) throws SchemaException
SchemaException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |