use of io.vertigo.dynamo.domain.metamodel.association.AssociationNode in project vertigo by KleeGroup.
the class DomainDynamicRegistry method createAssociationNNDefinition.
private static AssociationNNDefinition createAssociationNNDefinition(final DefinitionSpace definitionSpace, final DslDefinition xassociation) {
final String tableName = (String) xassociation.getPropertyValue(KspProperty.TABLE_NAME);
final DtDefinition dtDefinitionA = definitionSpace.resolve(xassociation.getDefinitionLinkName("dtDefinitionA"), DtDefinition.class);
final boolean navigabilityA = (Boolean) xassociation.getPropertyValue(KspProperty.NAVIGABILITY_A);
final String roleA = (String) xassociation.getPropertyValue(KspProperty.ROLE_A);
final String labelA = (String) xassociation.getPropertyValue(KspProperty.LABEL_A);
final DtDefinition dtDefinitionB = definitionSpace.resolve(xassociation.getDefinitionLinkName("dtDefinitionB"), DtDefinition.class);
final boolean navigabilityB = (Boolean) xassociation.getPropertyValue(KspProperty.NAVIGABILITY_B);
final String roleB = (String) xassociation.getPropertyValue(KspProperty.ROLE_B);
final String labelB = (String) xassociation.getPropertyValue(KspProperty.LABEL_B);
final AssociationNode associationNodeA = new AssociationNode(dtDefinitionA, navigabilityA, roleA, labelA, true, false);
final AssociationNode associationNodeB = new AssociationNode(dtDefinitionB, navigabilityB, roleB, labelB, true, false);
final String name = fixAssociationName(ASSOCIATION_NN_DEFINITION_PREFIX, xassociation.getName());
return new AssociationNNDefinition(name, tableName, associationNodeA, associationNodeB);
}
Aggregations