*/
private void serializeColumn(Column col, ColType type, String secondary,
boolean unique, AnnotationBuilder ab, Object meta) {
FieldMetaData fmd = meta instanceof FieldMetaData ?
(FieldMetaData) meta : null;
AnnotationBuilder abCol = newAnnotationBuilder(
type.getColumnAnnotationType());
if (col.getName() != null && (null == fmd ||
!col.getName().equalsIgnoreCase(fmd.getName())))
abCol.add("name", col.getName());
if (col.getTypeName() != null)
abCol.add("columnDefinition", col.getTypeName());
if (col.getTarget() != null
&& (type == ColType.JOIN || type == ColType.INVERSE
|| type == ColType.PK_JOIN))
abCol.add("referencedColumnName", col.getTarget());
if (type == ColType.COL || type == ColType.JOIN
|| type == ColType.PK_JOIN) {
if (unique)
abCol.add("unique", true);
if (col.isNotNull())
abCol.add("nullable", false);
if (col.getFlag(Column.FLAG_UNINSERTABLE))
abCol.add("insertable", false);
if (col.getFlag(Column.FLAG_UNUPDATABLE))
abCol.add("updatable", false);
if (secondary != null)
abCol.add("table", secondary);
if (type == ColType.COL) {
if (col.getSize() > 0 && col.getSize() != 255)
abCol.add("length", col.getSize());
if (col.getDecimalDigits() != 0)
abCol.add("scale", col.getDecimalDigits());
}
}
if (type != ColType.COL || abCol.hasComponents()) {
if (null != ab) {
String key = null;
if (ab.getType() == JoinTable.class) {
switch(type) {
case JOIN: