entity-cmp-20.vm has a new bug that generates
noncompilable ejbPostCreate for the (nullable and not
nullable) ejbCreate. I've included my fix for this.
The $allCreateSignature only contains TargetOne roles.
$table.notMandatoryRelationshipRoles contains both
TargetOne and TargetMany. THis could also be fixed in
the java by adding a oneNotMandatoryRelationshipRoles
using a valid predicate.
/**
* The container invokes this method immediately
after it calls ejbCreate.
*
#foreach( $column in $allColumns )
* @param ${column.variableName} the
${column.variableName} value
#end
#foreach($relationshipRole in $table.oneRelationshipRoles)
* @param $table.getVariableName($relationshipRole)
CMR field
#end
*/
public void ejbPostCreate( $allCreateSignature )
throws javax.ejb.CreateException {
+#cmrSetters($table.mandatoryRelationshipRoles)
-#cmrSetters($table.notMandatoryRelationshipRoles)
}
Logged In: NO
An additional bug occurs using the
'getColumnAndRelationSignature'-method in class
middlegen.javax.JavaTable. If one wants to get
$allCreateSignature using 'getColumnAndRelationSignature'
any TOMANY relationship is serialized to the create
signature in a wrong way:
In the submethod 'getRelationSignature' targetType is always
the interface name, but should be a collection when the
relationship is TOMANY.
sb.append(targetType).append(" ").append(targetName);
THE CODEFRAGMENT
String targetType = target.getDestinationClassName();
String targetName = origin.getVariableName(role);
sb.append(targetType).append(" ").append(targetName);
SHOULD BE SOMETHING LIKE THIS
String targetName = origin.getVariableName(role);
String targetType = null;
if (role.isTargetMany())
{
targetType = "java.util.Collection";
} else {
targetType = target.getDestinationClassName();
}
sb.append(targetType).append(" ").append(targetName);