com.sun.jdo.spi.persistence.support.ejb.ejbc
Class JDOCodeGenerator

java.lang.Object
  extended by com.sun.jdo.spi.persistence.support.ejb.ejbc.JDOCodeGenerator
All Implemented Interfaces:
CMPGenerator, DatabaseConstants

public class JDOCodeGenerator
extends Object
implements CMPGenerator, DatabaseConstants


Field Summary
static String SIGNATURE
          Signature with CVS keyword substitution for identifying the generated code
 
Fields inherited from interface org.glassfish.persistence.common.DatabaseConstants
CREATE, CREATE_DDL_JDBC_FILE_SUFFIX, CREATE_SQL_FILE_SUFFIX, DDL, DROP, DROP_DDL_JDBC_FILE_SUFFIX, DROP_SQL_FILE_SUFFIX, JAVA_TO_DB_FLAG, JDBC_FILE_EXTENSION, JTA_DATASOURCE_JNDI_NAME_OVERRIDE, NAME_SEPARATOR, SQL_FILE_EXTENSION
 
Constructor Summary
JDOCodeGenerator()
           
 
Method Summary
 Collection cleanup()
          This method is called once for each ejb module in the application that contains CMP beans.
 void generate(IASEjbCMPEntityDescriptor ejbcmp, File srcout, File classout)
          This method is called once for each CMP bean of the corresponding ejb module.
 void init(EjbBundleDescriptor bundle, ClassLoader loader, String bundlePathName)
          Deprecated.  
 void init(EjbBundleDescriptor bundle, ClassLoader loader, String bundlePathName, boolean ignoreSunDeploymentDescriptors)
          Called by static verifier to bypass mapping validation or internally by other init() methods.
 void init(EjbBundleDescriptor bundle, DeploymentContext ctx, String bundlePathName, String generatedXmlsPathName)
          This method is called once for each ejb module in the application that contains CMP beans.
 Collection validate(IASEjbCMPEntityDescriptor descr)
          This method may be called once for each CMP bean of the corresponding ejb module to perform the validation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIGNATURE

public static final String SIGNATURE
Signature with CVS keyword substitution for identifying the generated code

See Also:
Constant Field Values
Constructor Detail

JDOCodeGenerator

public JDOCodeGenerator()
Method Detail

init

public void init(EjbBundleDescriptor bundle,
                 DeploymentContext ctx,
                 String bundlePathName,
                 String generatedXmlsPathName)
          throws GeneratorException
Description copied from interface: CMPGenerator
This method is called once for each ejb module in the application that contains CMP beans. Only one #init() method can be called.

Specified by:
init in interface CMPGenerator
Parameters:
bundle - the EjbBundleDescriptor associated with this ejb module.
ctx - the DeploymentContext associated with the deployment request.
bundlePathName - full path to the directory where this bundle's files are located.
generatedXmlsPathName - full path to the directory where the generated files are located.
Throws:
GeneratorException - if there is a problem initializing bean processing.
See Also:
CMPGenerator.init(EjbBundleDescriptor, DeploymentContext, String, String)

init

public void init(EjbBundleDescriptor bundle,
                 ClassLoader loader,
                 String bundlePathName)
          throws GeneratorException
Deprecated. 

Description copied from interface: CMPGenerator
This method is called once for each ejb module in the application that contains CMP beans. Only one #init() method can be called.

Specified by:
init in interface CMPGenerator
Parameters:
bundle - the EjbBundleDescriptor associated with this ejb module.
loader - the ClassLoader that loaded user defined classes.
bundlePathName - full path to the directory where this bundle's files are located.
Throws:
GeneratorException - if there is a problem initializing bean processing.
See Also:
This method should be merged with {@link #init(EjbBundleDescriptor, DeploymentContext, String)} when TestFramework is fixed for optional pm-descriptors and java2db support.

init

public void init(EjbBundleDescriptor bundle,
                 ClassLoader loader,
                 String bundlePathName,
                 boolean ignoreSunDeploymentDescriptors)
          throws GeneratorException
Called by static verifier to bypass mapping validation or internally by other init() methods. Will force java2db generation if ignoreSunDeploymentDescriptors is true.

Throws:
GeneratorException
See Also:
CMPGenerator.init(EjbBundleDescriptor, ClassLoader, String)

validate

public Collection validate(IASEjbCMPEntityDescriptor descr)
Description copied from interface: CMPGenerator
This method may be called once for each CMP bean of the corresponding ejb module to perform the validation.

Specified by:
validate in interface CMPGenerator
Parameters:
descr - the IASEjbCMPEntityDescriptor associated with this CMP bean.
Returns:
a Collection of Exceptions if there are any problems processing the bean. Returns an empty Collection if validation succeeds.
See Also:
CMPGenerator.validate(IASEjbCMPEntityDescriptor descr)

generate

public void generate(IASEjbCMPEntityDescriptor ejbcmp,
                     File srcout,
                     File classout)
              throws GeneratorException
Description copied from interface: CMPGenerator
This method is called once for each CMP bean of the corresponding ejb module.

Specified by:
generate in interface CMPGenerator
Parameters:
ejbcmp - the IASEjbCMPEntityDescriptor associated with this CMP bean.
srcout - the location of the source files to be generated.
classout - the location of the class files to be generated.
Throws:
GeneratorException - if there is a problem processing the bean.
See Also:
CMPGenerator.generate(IASEjbCMPEntityDescriptor, File, File)

cleanup

public Collection cleanup()
                   throws GeneratorException
Description copied from interface: CMPGenerator
This method is called once for each ejb module in the application that contains CMP beans. It is called at the end of the module processing.

Specified by:
cleanup in interface CMPGenerator
Returns:
a Collection of files to be compiled by the deployment process.
Throws:
GeneratorException - if there is any problem.


Copyright © 2012. All Rights Reserved.