anonymous.setPersistentField(null,fieldName);
}
else
{
String classname = m_CurrentCLD.getClassNameOfObject();
PersistentField pf = PersistentFieldFactory.createPersistentField(m_CurrentCLD.getPersistentFieldClassName(),ClassHelper.getClass(classname),fieldName);
m_CurrentFLD.setPersistentField(pf);
}
String columnName = atts.getValue(tags.getTagById(COLUMN_NAME));
if (isDebug) logger.debug(" " + tags.getTagById(COLUMN_NAME) + ": " + columnName);
m_CurrentFLD.setColumnName(columnName);
String jdbcType = atts.getValue(tags.getTagById(JDBC_TYPE));
if (isDebug) logger.debug(" " + tags.getTagById(JDBC_TYPE) + ": " + jdbcType);
m_CurrentFLD.setColumnType(jdbcType);
String primaryKey = atts.getValue(tags.getTagById(PRIMARY_KEY));
if (isDebug) logger.debug(" " + tags.getTagById(PRIMARY_KEY) + ": " + primaryKey);
boolean b = (Boolean.valueOf(primaryKey)).booleanValue();
m_CurrentFLD.setPrimaryKey(b);
String nullable = atts.getValue(tags.getTagById(NULLABLE));
if (nullable != null)
{
if (isDebug) logger.debug(" " + tags.getTagById(NULLABLE) + ": " + nullable);
b = !(Boolean.valueOf(nullable)).booleanValue();
m_CurrentFLD.setRequired(b);
}
String indexed = atts.getValue(tags.getTagById(INDEXED));
if (isDebug) logger.debug(" " + tags.getTagById(INDEXED) + ": " + indexed);
b = (Boolean.valueOf(indexed)).booleanValue();
m_CurrentFLD.setIndexed(b);
String autoincrement = atts.getValue(tags.getTagById(AUTO_INCREMENT));
if (isDebug) logger.debug(" " + tags.getTagById(AUTO_INCREMENT) + ": " + autoincrement);
b = (Boolean.valueOf(autoincrement)).booleanValue();
m_CurrentFLD.setAutoIncrement(b);
String sequenceName = atts.getValue(tags.getTagById(SEQUENCE_NAME));
if (isDebug) logger.debug(" " + tags.getTagById(SEQUENCE_NAME) + ": " + sequenceName);
m_CurrentFLD.setSequenceName(sequenceName);
String locking = atts.getValue(tags.getTagById(LOCKING));
if (isDebug) logger.debug(" " + tags.getTagById(LOCKING) + ": " + locking);
b = (Boolean.valueOf(locking)).booleanValue();
m_CurrentFLD.setLocking(b);
String updateLock = atts.getValue(tags.getTagById(UPDATE_LOCK));
if (isDebug) logger.debug(" " + tags.getTagById(UPDATE_LOCK) + ": " + updateLock);
if(checkString(updateLock))
{
b = (Boolean.valueOf(updateLock)).booleanValue();
m_CurrentFLD.setUpdateLock(b);
}
String fieldConversion = atts.getValue(tags.getTagById(FIELD_CONVERSION));
if (isDebug) logger.debug(" " + tags.getTagById(FIELD_CONVERSION) + ": " + fieldConversion);
if (fieldConversion != null)
{
m_CurrentFLD.setFieldConversionClassName(fieldConversion);
}
// set length attribute
String length = atts.getValue(tags.getTagById(LENGTH));
if (length != null)
{
int i = Integer.parseInt(length);
if (isDebug) logger.debug(" " + tags.getTagById(LENGTH) + ": " + i);
m_CurrentFLD.setLength(i);
m_CurrentFLD.setLengthSpecified(true);
}
// set precision attribute
String precision = atts.getValue(tags.getTagById(PRECISION));
if (precision != null)
{
int i = Integer.parseInt(precision);
if (isDebug) logger.debug(" " + tags.getTagById(PRECISION) + ": " + i);
m_CurrentFLD.setPrecision(i);
m_CurrentFLD.setPrecisionSpecified(true);
}
// set scale attribute
String scale = atts.getValue(tags.getTagById(SCALE));
if (scale != null)
{
int i = Integer.parseInt(scale);
if (isDebug) logger.debug(" " + tags.getTagById(SCALE) + ": " + i);
m_CurrentFLD.setScale(i);
m_CurrentFLD.setScaleSpecified(true);
}
break;
}
case REFERENCE_DESCRIPTOR:
{
if (isDebug) logger.debug(" > " + tags.getTagById(REFERENCE_DESCRIPTOR));
// set name attribute
name = atts.getValue(tags.getTagById(FIELD_NAME));
if (isDebug) logger.debug(" " + tags.getTagById(FIELD_NAME) + ": " + name);
// set class-ref attribute
String classRef = atts.getValue(tags.getTagById(REFERENCED_CLASS));
if (isDebug) logger.debug(" " + tags.getTagById(REFERENCED_CLASS) + ": " + classRef);
ObjectReferenceDescriptor ord = null;
if (name.equals(TAG_SUPER))
{
checkThis(classRef);
AnonymousObjectReferenceDescriptor aord =
new AnonymousObjectReferenceDescriptor(m_CurrentCLD);
aord.setPersistentField(null, TAG_SUPER);
ord = aord;
}
else
{
ord = new ObjectReferenceDescriptor(m_CurrentCLD);
PersistentField pf = PersistentFieldFactory.createPersistentField(m_CurrentCLD.getPersistentFieldClassName(),m_CurrentCLD.getClassOfObject(),name);
ord.setPersistentField(pf);
}
m_CurrentORD = ord;
// now we add the new descriptor
m_CurrentCLD.addObjectReferenceDescriptor(m_CurrentORD);
m_CurrentORD.setItemClass(ClassHelper.getClass(classRef));
// prepare for custom attributes
this.m_CurrentAttrContainer = m_CurrentORD;
// set proxy attribute
String proxy = atts.getValue(tags.getTagById(PROXY_REFERENCE));
if (isDebug) logger.debug(" " + tags.getTagById(PROXY_REFERENCE) + ": " + proxy);
boolean b = (Boolean.valueOf(proxy)).booleanValue();
m_CurrentORD.setLazy(b);
// set proxyPrefetchingLimit attribute
String proxyPrefetchingLimit = atts.getValue(tags.getTagById(PROXY_PREFETCHING_LIMIT));
if (isDebug) logger.debug(" " + tags.getTagById(PROXY_PREFETCHING_LIMIT) + ": " + proxyPrefetchingLimit);
if (proxyPrefetchingLimit == null)
{
m_CurrentORD.setProxyPrefetchingLimit(defProxyPrefetchingLimit);
}
else
{
m_CurrentORD.setProxyPrefetchingLimit(Integer.parseInt(proxyPrefetchingLimit));
}
// set refresh attribute
String refresh = atts.getValue(tags.getTagById(REFRESH));
if (isDebug) logger.debug(" " + tags.getTagById(REFRESH) + ": " + refresh);
b = (Boolean.valueOf(refresh)).booleanValue();
m_CurrentORD.setRefresh(b);
// set auto-retrieve attribute
String autoRetrieve = atts.getValue(tags.getTagById(AUTO_RETRIEVE));
if (isDebug) logger.debug(" " + tags.getTagById(AUTO_RETRIEVE) + ": " + autoRetrieve);
b = (Boolean.valueOf(autoRetrieve)).booleanValue();
m_CurrentORD.setCascadeRetrieve(b);
// set auto-update attribute
String autoUpdate = atts.getValue(tags.getTagById(AUTO_UPDATE));
if (isDebug) logger.debug(" " + tags.getTagById(AUTO_UPDATE) + ": " + autoUpdate);
if(autoUpdate != null)
{
m_CurrentORD.setCascadingStore(autoUpdate);
}
//set auto-delete attribute
String autoDelete = atts.getValue(tags.getTagById(AUTO_DELETE));
if (isDebug) logger.debug(" " + tags.getTagById(AUTO_DELETE) + ": " + autoDelete);
if(autoDelete != null)
{
m_CurrentORD.setCascadingDelete(autoDelete);
}
//set otm-dependent attribute
String otmDependent = atts.getValue(tags.getTagById(OTM_DEPENDENT));
if (isDebug) logger.debug(" " + tags.getTagById(OTM_DEPENDENT) + ": " + otmDependent);
b = (Boolean.valueOf(otmDependent)).booleanValue();
m_CurrentORD.setOtmDependent(b);
break;
}
case FOREIGN_KEY:
{
if (isDebug) logger.debug(" > " + tags.getTagById(FOREIGN_KEY));
String fieldIdRef = atts.getValue(tags.getTagById(FIELD_ID_REF));
if (fieldIdRef != null)
{
if (isDebug) logger.debug(" " + tags.getTagById(FIELD_ID_REF) + ": " + fieldIdRef);
try
{
int fieldId;
fieldId = Integer.parseInt(fieldIdRef);
m_CurrentORD.addForeignKeyField(fieldId);
}
catch (NumberFormatException rex)
{
throw new MetadataException(tags.getTagById(FIELD_ID_REF)
+ " attribute must be an int. Found: "
+ fieldIdRef + ". Please check your repository file.", rex);
}
}
else
{
String fieldRef = atts.getValue(tags.getTagById(FIELD_REF));
if (isDebug) logger.debug(" " + tags.getTagById(FIELD_REF) + ": " + fieldRef);
m_CurrentORD.addForeignKeyField(fieldRef);
}
break;
}
case COLLECTION_DESCRIPTOR:
{
if (isDebug) logger.debug(" > " + tags.getTagById(COLLECTION_DESCRIPTOR));
m_CurrentCOD = new CollectionDescriptor(m_CurrentCLD);
// prepare for custom attributes
this.m_CurrentAttrContainer = m_CurrentCOD;
// set name attribute
name = atts.getValue(tags.getTagById(FIELD_NAME));
if (isDebug) logger.debug(" " + tags.getTagById(FIELD_NAME) + ": " + name);
PersistentField pf = PersistentFieldFactory.createPersistentField(m_CurrentCLD.getPersistentFieldClassName(),m_CurrentCLD.getClassOfObject(),name);
m_CurrentCOD.setPersistentField(pf);
// set collection-class attribute
String collectionClassName = atts.getValue(tags.getTagById(COLLECTION_CLASS));
if (collectionClassName != null)