public class EjbConversionHelper extends Object implements com.sun.jdo.api.persistence.mapping.ejb.ConversionHelper
| Constructor and Description |
|---|
EjbConversionHelper(NameMapper nameMapper) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
applyDefaultUnknownPKClassStrategy(String ejbName)
Returns flag whether the mapping conversion should apply the default
strategy for dealing with unknown primary key classes.
|
boolean |
ensureValidation()
Returns the flag whether the mapping conversion should validate
all fields against schema columns.
|
boolean |
generateFields()
Returns the flag whether the mapping conversion should generate
relationship fields and primary key fields to support run-time.
|
Object[] |
getFields(String ejbName)
If
generateFields is true, then this method will
return an array of cmp + cmr + pseudo cmr fields, otherwise
the method will return an array of cmp + cmr fields. |
String |
getGeneratedPKFieldName()
Returns the name used for generated primary key fields.
|
List |
getGeneratedRelationships(String ejbName)
Returns a list of generated relationship field names.
|
String |
getGeneratedVersionFieldNamePrefix()
Returns the prefix used for generated version fields.
|
String |
getInverseFieldName(String ejbName,
String fieldName)
This method return the fieldName of relation role on the other end.
|
String |
getMappedClassName(String ejbName) |
String |
getMultiplicity(String ejbName,
String fieldName)
getMultiplicity of the other role on the relationship
Please note that multiplicity is JDO style
|
String |
getRelationshipFieldContent(String ejbName,
String fieldName) |
String |
getRelationshipFieldType(String ejbName,
String fieldName)
This API will only be called from MappingFile when multiplicity is Many
on the other role.
|
boolean |
hasField(String ejbName,
String fieldName)
If
generateFields is true, 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. |
boolean |
isGeneratedField(String ejbName,
String fieldName)
Returns
true if the field is generated. |
boolean |
isGeneratedRelationship(String ejbName,
String fieldName) |
boolean |
isKey(String ejbName,
String fieldName,
boolean candidate)
The boolean argument candidate is ignored in this case.
|
boolean |
relatedObjectsAreDeleted(String beanName,
String fieldName) |
void |
setEnsureValidation(boolean isValidating)
Sets the flag whether the mapping conversion should validate all fields
against schema columns.
|
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.
|
public EjbConversionHelper(NameMapper nameMapper)
public String getMappedClassName(String ejbName)
getMappedClassName in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperpublic boolean hasField(String ejbName, String fieldName)
generateFields is true, 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.hasField in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperejbName - The ejb-name element for the beanfieldName - The name of a container managed field in the named beantrue if the bean contains the field, otherwise
return falsepublic Object[] getFields(String ejbName)
generateFields is true, then this method will
return an array of cmp + cmr + pseudo cmr fields, otherwise
the method will return an array of cmp + cmr fields.getFields in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperejbName - The ejb-name element for the beanpublic boolean isKey(String ejbName, String fieldName, boolean candidate)
isKey in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperpublic String getRelationshipFieldType(String ejbName, String fieldName)
getRelationshipFieldType in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperpublic String getMultiplicity(String ejbName, String fieldName)
getMultiplicity in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperpublic String getRelationshipFieldContent(String ejbName, String fieldName)
getRelationshipFieldContent in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperpublic String getInverseFieldName(String ejbName, String fieldName)
getInverseFieldName in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperpublic boolean applyDefaultUnknownPKClassStrategy(String ejbName)
generateFields returns true.applyDefaultUnknownPKClassStrategy in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperejbName - The value of the ejb-name element for a bean.true to apply the default unknown PK Class Strategy,
false otherwisepublic String getGeneratedPKFieldName()
getGeneratedPKFieldName in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperpublic String getGeneratedVersionFieldNamePrefix()
getGeneratedVersionFieldNamePrefix in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperpublic boolean relatedObjectsAreDeleted(String beanName, String fieldName)
relatedObjectsAreDeleted in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperpublic boolean generateFields()
generateFields is
false because it holds version column information.generateFields in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelpertrue to generate fields in the dot-mapping file
(if they are not present).public void setGenerateFields(boolean generateFields)
setGenerateFields in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelpergenerateFields - a flag which indicates whether fields should be
generatedpublic boolean ensureValidation()
ensureValidation in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelpertrue to validate all the fields in the dot-mapping
file.public void setEnsureValidation(boolean isValidating)
setEnsureValidation in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperisValidating - a boolean of indicating validating fields or notpublic boolean isGeneratedField(String ejbName, String fieldName)
true if the field is generated. There are three
types of generated fields: generated relationships, unknown primary key
fields, and version consistency fields.isGeneratedField in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperejbName - The ejb-name element for the beanfieldName - The name of a container managed field in the named beantrue if the field is generated; false
otherwise.public boolean isGeneratedRelationship(String ejbName, String fieldName)
isGeneratedRelationship in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperpublic List getGeneratedRelationships(String ejbName)
getGeneratedRelationships in interface com.sun.jdo.api.persistence.mapping.ejb.ConversionHelperejbName - The ejb-name element for the beanCopyright © 2017–2020 Eclipse Foundation. All rights reserved.