overriddenFields = new HashSet<AbstractMemberMetaData>();
}
for (int j=0;j<overrides.length;j++)
{
AbstractMemberMetaData fmd = new FieldMetaData(cmd,
"#UNKNOWN." + overrides[j].name());
fmd.setPersistenceModifier(FieldPersistenceModifier.PERSISTENT.toString());
Column col = overrides[j].column();
// TODO Make inferrals about jdbctype, length etc if the field is 1 char etc
ColumnMetaData colmd = new ColumnMetaData();
colmd.setName(col.name());
colmd.setLength(col.length());
colmd.setScale(col.scale());
colmd.setAllowsNull(col.nullable());
colmd.setInsertable(col.insertable());
colmd.setUpdateable(col.updatable());
colmd.setUnique(col.unique());
fmd.addColumn(colmd);
overriddenFields.add(fmd);
}
}
}
else if (annName.equals(JPAAnnotationUtils.ATTRIBUTE_OVERRIDE))
{
if (overriddenFields == null)
{
overriddenFields = new HashSet<AbstractMemberMetaData>();
}
AbstractMemberMetaData fmd = new FieldMetaData(cmd,
"#UNKNOWN." + (String)annotationValues.get("name"));
Column col = (Column)annotationValues.get("column");
// TODO Make inferrals about jdbctype, length etc if the field is 1 char etc
ColumnMetaData colmd = new ColumnMetaData();
colmd.setName(col.name());
colmd.setLength(col.length());
colmd.setScale(col.scale());
colmd.setAllowsNull(col.nullable());
colmd.setInsertable(col.insertable());
colmd.setUpdateable(col.updatable());
colmd.setUnique(col.unique());
fmd.addColumn(colmd);
overriddenFields.add(fmd);
}
else if (annName.equals(JPAAnnotationUtils.ASSOCIATION_OVERRIDES))
{
AssociationOverride[] overrides = (AssociationOverride[])annotationValues.get("value");
if (overrides != null)
{
if (overriddenFields == null)
{
overriddenFields = new HashSet<AbstractMemberMetaData>();
}
for (int j=0;j<overrides.length;j++)
{
AbstractMemberMetaData fmd = new FieldMetaData(cmd,
"#UNKNOWN." + overrides[j].name());
JoinColumn[] cols = overrides[j].joinColumns();
for (int k=0;k<cols.length;k++)
{
ColumnMetaData colmd = new ColumnMetaData();
colmd.setName(cols[k].name());
colmd.setTarget(cols[k].referencedColumnName());
colmd.setAllowsNull(cols[k].nullable());
colmd.setInsertable(cols[k].insertable());
colmd.setUpdateable(cols[k].updatable());
colmd.setUnique(cols[k].unique());
fmd.addColumn(colmd);
}
overriddenFields.add(fmd);
}
}
}
else if (annName.equals(JPAAnnotationUtils.ASSOCIATION_OVERRIDE))
{
if (overriddenFields == null)
{
overriddenFields = new HashSet<AbstractMemberMetaData>();
}
AbstractMemberMetaData fmd = new FieldMetaData(cmd,
"#UNKNOWN." + (String)annotationValues.get("name"));
JoinColumn[] cols = (JoinColumn[])annotationValues.get("joinColumns");
for (int k=0;k<cols.length;k++)
{
ColumnMetaData colmd = new ColumnMetaData();
colmd.setName(cols[k].name());
colmd.setTarget(cols[k].referencedColumnName());
colmd.setAllowsNull(cols[k].nullable());
colmd.setInsertable(cols[k].insertable());
colmd.setUpdateable(cols[k].updatable());
colmd.setUnique(cols[k].unique());
fmd.addColumn(colmd);
}
overriddenFields.add(fmd);
}
else if (annName.equals(JPAAnnotationUtils.NAMED_QUERIES))
{