final String userClass = ca.userClassName();
final String fieldName = theField.name().asString();
final String fullFieldName = userFieldName();
//@olsen: added shortcut
final JDOMetaData jdoMetaData = env.getJDOMetaData();
//@olsen: use JDO meta data to decide whether a field is persistent
//@olsen: subst: fieldShouldBeTransient -> !fieldShouldBePersistent
final boolean fieldShouldBePersistent
= jdoMetaData.isPersistentField(className, fieldName);
//@olsen: added println() for debugging
if (false) {
System.out.println("FieldAction.check(): field "//NOI18N
+ className + "/" + fieldName//NOI18N
+ " should be persistent = "//NOI18N
+ fieldShouldBePersistent);
}
//@olsen: initialized property from JDO meta data
fieldIsPrimaryKey
= jdoMetaData.isPrimaryKeyField(className, fieldName);
//@olsen: added println() for debugging
if (false) {
System.out.println("FieldAction.check(): field "//NOI18N
+ className + "/" + fieldName//NOI18N
+ " is primary key = "//NOI18N
+ fieldIsPrimaryKey);
}
//@olsen: initialized property from JDO meta data
fieldIsMutableSCO
= jdoMetaData.isMutableSecondClassObjectType(typeName());
//@olsen: added println() for debugging
if (false) {
System.out.println("FieldAction.check(): field "//NOI18N
+ className + "/" + fieldName//NOI18N
+ " is mutable SCO = "//NOI18N
+ fieldIsMutableSCO);
}
nFieldArrayDims = 0;
while (sig.charAt(nFieldArrayDims) == '[')
nFieldArrayDims++;
// If the base type is a class type, compute the class name
if (sig.charAt(nFieldArrayDims) == 'L')
fieldClassName = sig.substring(nFieldArrayDims+1, sig.length()-1);
// check for transient field
if (!fieldShouldBePersistent) {
// done with transient field
return;
}
//@olsen: dropped code ...
// check for static field
affirm(!theField.isStatic(),
("The field " + fullFieldName//NOI18N
+ " is a static field which cannot be made persistent."));//NOI18N
// check for final field
affirm(!theField.isFinal(),
("The field " + fullFieldName +//NOI18N
" is a final field which cannot be made persistent."));//NOI18N
// check for target type
affirm((fieldClassName == null
|| jdoMetaData.isSecondClassObjectType(fieldClassName)
|| jdoMetaData.isPersistenceCapableClass(fieldClassName)),
("The field " + fullFieldName//NOI18N
+ " cannot be made persistent because of a non-primitive, "//NOI18N
+ " non-sco, or non-pc target type " + fieldClassName));//NOI18N
fieldIsPersistent = true;