Class EjbConversionHelper
java.lang.Object
com.sun.jdo.spi.persistence.support.ejb.ejbc.EjbConversionHelper
- All Implemented Interfaces:
com.sun.jdo.api.persistence.mapping.ejb.ConversionHelper
public class EjbConversionHelper
extends Object
implements com.sun.jdo.api.persistence.mapping.ejb.ConversionHelper
-
Field Summary
Fields inherited from interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelper
MANY, ONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyDefaultUnknownPKClassStrategy(String ejbName) Returns flag whether the mapping conversion should apply the default strategy for dealing with unknown primary key classes.booleanReturns the flag whether the mapping conversion should validate all fields against schema columns.booleanReturns the flag whether the mapping conversion should generate relationship fields and primary key fields to support run-time.Object[]IfgenerateFieldsistrue, then this method will return an array of cmp + cmr + pseudo cmr fields, otherwise the method will return an array of cmp + cmr fields.Returns the name used for generated primary key fields.getGeneratedRelationships(String ejbName) Returns a list of generated relationship field names.Returns the prefix used for generated version fields.getInverseFieldName(String ejbName, String fieldName) This method return the fieldName of relation role on the other end.getMappedClassName(String ejbName) getMultiplicity(String ejbName, String fieldName) getMultiplicity of the other role on the relationship Please note that multiplicity is JDO stylegetRelationshipFieldContent(String ejbName, String fieldName) getRelationshipFieldType(String ejbName, String fieldName) This API will only be called from MappingFile when multiplicity is Many on the other role.booleanIfgenerateFieldsistrue, then this method will check if the field is one of the cmp + cmr + pseudo cmr fields, otherwise the method will check if the field is one of the cmp + cmr fields.booleanisGeneratedField(String ejbName, String fieldName) Returnstrueif the field is generated.booleanisGeneratedRelationship(String ejbName, String fieldName) booleanThe boolean argument candidate is ignored in this case.booleanrelatedObjectsAreDeleted(String beanName, String fieldName) voidsetEnsureValidation(boolean isValidating) Sets the flag whether the mapping conversion should validate all fields against schema columns.voidsetGenerateFields(boolean generateFields) Sets the flag whether the mapping conversion should generate relationship fields, primary key fields, and version fields to support run-time.
-
Constructor Details
-
EjbConversionHelper
-
-
Method Details
-
getMappedClassName
- Specified by:
getMappedClassNamein interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper
-
hasField
IfgenerateFieldsistrue, then this method will check if the field is one of the cmp + cmr + pseudo cmr fields, otherwise the method will check if the field is one of the cmp + cmr fields.- Specified by:
hasFieldin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper- Parameters:
ejbName- The ejb-name element for the beanfieldName- The name of a container managed field in the named bean- Returns:
trueif the bean contains the field, otherwise returnfalse
-
getFields
IfgenerateFieldsistrue, then this method will return an array of cmp + cmr + pseudo cmr fields, otherwise the method will return an array of cmp + cmr fields.- Specified by:
getFieldsin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper- Parameters:
ejbName- The ejb-name element for the bean- Returns:
- an array of fields in the ejb bean
-
isKey
The boolean argument candidate is ignored in this case.- Specified by:
isKeyin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper
-
getRelationshipFieldType
This API will only be called from MappingFile when multiplicity is Many on the other role.- Specified by:
getRelationshipFieldTypein interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper
-
getMultiplicity
getMultiplicity of the other role on the relationship Please note that multiplicity is JDO style- Specified by:
getMultiplicityin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper
-
getRelationshipFieldContent
- Specified by:
getRelationshipFieldContentin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper
-
getInverseFieldName
This method return the fieldName of relation role on the other end.- Specified by:
getInverseFieldNamein interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper
-
applyDefaultUnknownPKClassStrategy
Returns flag whether the mapping conversion should apply the default strategy for dealing with unknown primary key classes. This method will only be called whengenerateFieldsreturnstrue.- Specified by:
applyDefaultUnknownPKClassStrategyin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper- Parameters:
ejbName- The value of the ejb-name element for a bean.- Returns:
trueto apply the default unknown PK Class Strategy,falseotherwise
-
getGeneratedPKFieldName
Returns the name used for generated primary key fields.- Specified by:
getGeneratedPKFieldNamein interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper- Returns:
- a string for key field name
-
getGeneratedVersionFieldNamePrefix
Returns the prefix used for generated version fields.- Specified by:
getGeneratedVersionFieldNamePrefixin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper- Returns:
- a string for version field name prefix
-
generateFields
public boolean generateFields()Returns the flag whether the mapping conversion should generate relationship fields and primary key fields to support run-time. The version field is always created evengenerateFieldsisfalsebecause it holds version column information.- Specified by:
generateFieldsin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper- Returns:
trueto generate fields in the dot-mapping file (if they are not present).
-
setGenerateFields
public void setGenerateFields(boolean generateFields) Sets the flag whether the mapping conversion should generate relationship fields, primary key fields, and version fields to support run-time.- Specified by:
setGenerateFieldsin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper- Parameters:
generateFields- a flag which indicates whether fields should be generated
-
ensureValidation
public boolean ensureValidation()Returns the flag whether the mapping conversion should validate all fields against schema columns.- Specified by:
ensureValidationin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper- Returns:
trueto validate all the fields in the dot-mapping file.
-
setEnsureValidation
public void setEnsureValidation(boolean isValidating) Sets the flag whether the mapping conversion should validate all fields against schema columns.- Specified by:
setEnsureValidationin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper- Parameters:
isValidating- a boolean of indicating validating fields or not
-
isGeneratedField
Returnstrueif the field is generated. There are three types of generated fields: generated relationships, unknown primary key fields, and version consistency fields.- Specified by:
isGeneratedFieldin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper- Parameters:
ejbName- The ejb-name element for the beanfieldName- The name of a container managed field in the named bean- Returns:
trueif the field is generated;falseotherwise.
-
isGeneratedRelationship
- Specified by:
isGeneratedRelationshipin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper
-
getGeneratedRelationships
Returns a list of generated relationship field names.- Specified by:
getGeneratedRelationshipsin interfacecom.sun.jdo.api.persistence.mapping.ejb.ConversionHelper- Parameters:
ejbName- The ejb-name element for the bean- Returns:
- a list of generated relationship field names
-