FileDocCategorySizeDatePackage
ConversionHelper.javaAPI DocGlassfish v2 API8996Fri May 04 22:34:42 BST 2007com.sun.jdo.api.persistence.mapping.ejb

ConversionHelper

public interface ConversionHelper
Helper interface for the {@link 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.
author
vkraemer
version
1.0

Fields Summary
public static final String
ONE
public static final String
MANY
Constructors Summary
Methods Summary
public booleanapplyDefaultUnknownPKClassStrategy(java.lang.String ejbName)
Returns flag whether the mapping conversion should apply the default strategy for dealing with unknown primary key classes. This method will only be called when {@link #generateFields} returns true.

param
ejbName The value of the ejb-name element for a bean.
return
true to apply the default unknown PK Class Strategy, false otherwise

public booleanensureValidation()
Returns the flag whether the mapping conversion should validate all fields against schema columns.

return
true to validate all the fields in the dot-mapping file.

public booleangenerateFields()
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 even {@link #generateFields} is false because it holds version column information.

return
true to generate fields in the dot-mapping file (if they are not present).

public java.lang.Object[]getFields(java.lang.String beanName)

public java.lang.StringgetGeneratedPKFieldName()
Returns the name used for generated primary key fields.

return
a string for key field name

public java.util.ListgetGeneratedRelationships(java.lang.String ejbName)
Returns a list of generated relationship field names.

param
ejbName The ejb-name element for the bean
return
a list of generated relationship field names

public java.lang.StringgetGeneratedVersionFieldNamePrefix()
Returns the prefix used for generated version fields.

return
a string for version field name prefix

public java.lang.StringgetInverseFieldName(java.lang.String ejbName, java.lang.String fieldName)

param
ejbName The value of the ejb-name element for a bean.
param
fieldName The name of a container managed field in the named bean.
return

public java.lang.StringgetMappedClassName(java.lang.String beanName)
Computes the name of the TP implementation class for a bean.

param
beanName The value of the ejb-name element for a bean.
return
The full name of the TP class that implements the fields and relationships of an EJB.

public java.lang.StringgetMultiplicity(java.lang.String ejbName, java.lang.String fieldName)

param
ejbName The ejb-name element for the bean
param
fieldName The name of a container managed field in the named bean.
return
The String values "One" or "Many".

public java.lang.StringgetRelationshipFieldContent(java.lang.String ejbName, java.lang.String fieldName)
Return the name of the opposite roles ejb-name

param
ejbName The value of the ejb-name element for a bean.
param
fieldName The name of a container managed field in the named bean.
return
The ejb-name of the bean that is referenced by a relationship field. This is the ejb-name of the "other" roles relationship-role-source.

public java.lang.StringgetRelationshipFieldType(java.lang.String ejbName, java.lang.String fieldName)

param
ejbName The value of the ejb-name element for a bean.
param
fieldName The name of a container managed field in the named bean.
return

public booleanhasField(java.lang.String beanName, java.lang.String fieldName)

param
beanName Name of bean to investigate for field.
param
fieldName Name of field sought in named bean.
return
True if the named bean has the named field

public booleanisGeneratedField(java.lang.String ejbName, java.lang.String fieldName)
Returns true if the field is generated. There are three types of generated fields: generated relationships, unknown primary key fields, and version consistency fields.

param
ejbName The ejb-name element for the bean
param
fieldName The name of a container managed field in the named bean
return
true if the field is generated; false otherwise.

public booleanisGeneratedRelationship(java.lang.String ejbName, java.lang.String fieldName)
Flag whether the conversion helper generated the relationship field

param
ejbName The ejb-name element for the bean
param
fieldName The name of a container managed field in the named bean.
return
true if the field was created by the conversion helper.

public booleanisKey(java.lang.String beanName, java.lang.String fieldName, boolean candidate)
Compute the keyness of a field. The value returned is the keyness of the field, if it is computable. If it is not, the candidate value is returned.

param
ejbName The value of the ejb-name element for a bean.
param
fieldName The name of a container managed field in the named bean.
param
candidate The value "proposed" by the content of the sun-cmp-mapping file.
return
The real value of the keyness of a field. This may be different than the candidate value, if the correct values of a fields keyness can be computed from available data.

public booleanrelatedObjectsAreDeleted(java.lang.String ejbName, java.lang.String fieldName)

param
ejbName The ejb-name element for the bean
param
fieldName The name of a container managed field in the named bean.
return
boolean flag indicating whether the objects in this collection field are to be deleted when this field' owning object is deleted.

public voidsetEnsureValidation(boolean isValidating)
Sets the flag whether the mapping conversion should validate all fields against schema columns.

param
isValidating a boolean of indicating validating fields or not

public voidsetGenerateFields(boolean generateFields)
Sets the flag whether the mapping conversion should generate relationship fields, primary key fields, and version fields to support run-time.

param
generateFields a flag which indicates whether fields should be generated