Search in sources :

Example 1 with ValueMetadata

use of javax.jdo.metadata.ValueMetadata in project motech by motech.

the class EntityMetadataBuilderImpl method copyParametersFromValueAnnotation.

private void copyParametersFromValueAnnotation(FieldMetadata fmd, Value valueAnnotation) {
    ValueMetadata valueMetadata = fmd.newValueMetadata();
    for (Column column : valueAnnotation.columns()) {
        ColumnMetadata colMd = valueMetadata.newColumnMetadata();
        colMd.setName(column.name());
        colMd.setLength(column.length());
        colMd.setAllowsNull(Boolean.parseBoolean(column.allowsNull()));
        colMd.setDefaultValue(column.defaultValue());
        colMd.setInsertValue(column.insertValue());
        colMd.setJDBCType(column.jdbcType());
        colMd.setSQLType(column.sqlType());
    }
}
Also used : ColumnMetadata(javax.jdo.metadata.ColumnMetadata) Column(javax.jdo.annotations.Column) ValueMetadata(javax.jdo.metadata.ValueMetadata)

Aggregations

Column (javax.jdo.annotations.Column)1 ColumnMetadata (javax.jdo.metadata.ColumnMetadata)1 ValueMetadata (javax.jdo.metadata.ValueMetadata)1