Search in sources :

Example 6 with FieldDefinitionImpl

use of com.qcadoo.model.internal.FieldDefinitionImpl in project qcadoo by qcadoo.

the class ModelXmlToDefinitionConverterImpl method getPriorityFieldDefinition.

private FieldDefinition getPriorityFieldDefinition(final XMLStreamReader reader, final DataDefinitionImpl dataDefinition) {
    String scopeAttribute = getStringAttribute(reader, "scope");
    FieldDefinition scopedField = null;
    if (scopeAttribute != null) {
        scopedField = dataDefinition.getField(scopeAttribute);
    }
    return new FieldDefinitionImpl(dataDefinition, getStringAttribute(reader, "name")).withType(new PriorityType(scopedField));
}
Also used : FieldDefinition(com.qcadoo.model.api.FieldDefinition) FieldDefinitionImpl(com.qcadoo.model.internal.FieldDefinitionImpl)

Example 7 with FieldDefinitionImpl

use of com.qcadoo.model.internal.FieldDefinitionImpl in project qcadoo by qcadoo.

the class ModelXmlToDefinitionConverterImpl method addVersionFields.

private void addVersionFields(final DataDefinitionImpl dataDefinition) {
    FieldDefinitionImpl fieldDefinition = new FieldDefinitionImpl(dataDefinition, VersionableConstants.VERSION_FIELD_NAME);
    fieldDefinition.withReadOnly(false);
    fieldDefinition.setPersistent(true);
    fieldDefinition.withType(new LongType(false));
    dataDefinition.withField(fieldDefinition);
}
Also used : FieldDefinitionImpl(com.qcadoo.model.internal.FieldDefinitionImpl)

Aggregations

FieldDefinitionImpl (com.qcadoo.model.internal.FieldDefinitionImpl)7 FieldDefinition (com.qcadoo.model.api.FieldDefinition)4 Test (org.junit.Test)3 Entity (com.qcadoo.model.api.Entity)2 FieldType (com.qcadoo.model.api.types.FieldType)2 DefaultEntity (com.qcadoo.model.internal.DefaultEntity)2 StringType (com.qcadoo.model.internal.types.StringType)2 DataAccessTest (com.qcadoo.model.internal.DataAccessTest)1 IntegerType (com.qcadoo.model.internal.types.IntegerType)1 PriorityType (com.qcadoo.model.internal.types.PriorityType)1