public interface ConversionHelper
MappingFile
.
The mapping file classes use an object that
implements this interface to assist in the conversion
from the sun-cmp-mapping file, into a TP dot-mapping file.
The APIs to the deployment descriptors differ at deployment time
and at development time. This interface provides a level of abstraction
for the needed information.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 beanName) |
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) |
String |
getMappedClassName(String beanName)
Computes the name of the TP implementation class for a bean.
|
String |
getMultiplicity(String ejbName,
String fieldName) |
String |
getRelationshipFieldContent(String ejbName,
String fieldName)
Return the name of the opposite roles ejb-name
|
String |
getRelationshipFieldType(String ejbName,
String fieldName) |
boolean |
hasField(String beanName,
String fieldName) |
boolean |
isGeneratedField(String ejbName,
String fieldName)
Returns
true if the field is generated. |
boolean |
isGeneratedRelationship(String ejbName,
String fieldName)
Flag whether the conversion helper generated the relationship field
|
boolean |
isKey(String beanName,
String fieldName,
boolean candidate)
Compute the keyness of a field.
|
boolean |
relatedObjectsAreDeleted(String ejbName,
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.
|
static final String ONE
static final String MANY
String getMappedClassName(String beanName)
beanName
- The value of the ejb-name element for a bean.boolean hasField(String beanName, String fieldName)
beanName
- Name of bean to investigate for field.fieldName
- Name of field sought in named bean.boolean isKey(String beanName, String fieldName, boolean candidate)
beanName
- The value of the ejb-name element for a bean.fieldName
- The name of a container managed field in the named bean.candidate
- The value "proposed" by the content of the sun-cmp-mapping file.String getRelationshipFieldContent(String ejbName, String fieldName)
ejbName
- The value of the ejb-name element for a bean.fieldName
- The name of a container managed field in the named bean.String getMultiplicity(String ejbName, String fieldName)
ejbName
- The ejb-name element for the beanfieldName
- The name of a container managed field in the named bean.String getRelationshipFieldType(String ejbName, String fieldName)
ejbName
- The value of the ejb-name element for a bean.fieldName
- The name of a container managed field in the named bean.String getInverseFieldName(String ejbName, String fieldName)
ejbName
- The value of the ejb-name element for a bean.fieldName
- The name of a container managed field in the named bean.boolean applyDefaultUnknownPKClassStrategy(String ejbName)
generateFields()
returns true
.ejbName
- The value of the ejb-name element for a bean.true
to apply the default unknown PK Class Strategy,
false
otherwiseString getGeneratedPKFieldName()
String getGeneratedVersionFieldNamePrefix()
boolean relatedObjectsAreDeleted(String ejbName, String fieldName)
ejbName
- The ejb-name element for the beanfieldName
- The name of a container managed field in the named bean.boolean generateFields()
generateFields()
is
false
because it holds version column information.true
to generate fields in the dot-mapping file
(if they are not present).void setGenerateFields(boolean generateFields)
generateFields
- a flag which indicates whether fields should be
generatedboolean ensureValidation()
true
to validate all the fields in the dot-mapping
file.void setEnsureValidation(boolean isValidating)
isValidating
- a boolean of indicating validating fields or notboolean 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.ejbName
- 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.boolean isGeneratedRelationship(String ejbName, String fieldName)
ejbName
- The ejb-name element for the beanfieldName
- The name of a container managed field in the named bean.true
if the field was created by the conversion
helper.Copyright © 2018. All rights reserved.