use of io.vertigo.dynamo.domain.metamodel.association.AssociationNNDefinition in project vertigo by KleeGroup.
the class OOMParserTest method testAssoctationAnBnv.
/**
* Test d'une relation An - Bnv.
*/
@Test
public void testAssoctationAnBnv() {
final AssociationNNDefinition association = getAssociationNNDefinition("ANN_CHA_CHI_7");
/* "0..*" */
Assert.assertTrue(association.getAssociationNodeA().isMultiple());
Assert.assertFalse(association.getAssociationNodeA().isNotNull());
/* "0..*" */
Assert.assertTrue(association.getAssociationNodeB().isMultiple());
Assert.assertFalse(association.getAssociationNodeB().isNotNull());
Assert.assertEquals("R7A", association.getAssociationNodeA().getRole());
Assert.assertEquals("R7B", association.getAssociationNodeB().getRole());
Assert.assertFalse(association.getAssociationNodeA().isNavigable());
Assert.assertTrue(association.getAssociationNodeB().isNavigable());
}
use of io.vertigo.dynamo.domain.metamodel.association.AssociationNNDefinition in project vertigo by KleeGroup.
the class OOMParserTest method testAssoctationAnBn.
/**
* Test d'une relation An - Bn.
*/
@Test
public void testAssoctationAnBn() {
final AssociationNNDefinition association = getAssociationNNDefinition("ANN_CHA_CHI_9");
/* "0..*" */
Assert.assertTrue(association.getAssociationNodeA().isMultiple());
Assert.assertFalse(association.getAssociationNodeA().isNotNull());
/* "0..*" */
Assert.assertTrue(association.getAssociationNodeB().isMultiple());
Assert.assertFalse(association.getAssociationNodeB().isNotNull());
Assert.assertEquals("R9A", association.getAssociationNodeA().getRole());
Assert.assertEquals("R9B", association.getAssociationNodeB().getRole());
Assert.assertFalse(association.getAssociationNodeA().isNavigable());
Assert.assertFalse(association.getAssociationNodeB().isNavigable());
}
use of io.vertigo.dynamo.domain.metamodel.association.AssociationNNDefinition in project vertigo by KleeGroup.
the class EAXmiTestParserAA method testAssoctationAnBn.
/**
* Test d'une relation An - Bn.
*/
@Test
public void testAssoctationAnBn() {
final AssociationNNDefinition association = getAssociationNNDefinition("ANN_CHI_CHI_9");
/* "0..*" */
Assert.assertTrue(association.getAssociationNodeA().isMultiple());
Assert.assertFalse(association.getAssociationNodeA().isNotNull());
/* "0..*" */
Assert.assertTrue(association.getAssociationNodeB().isMultiple());
Assert.assertFalse(association.getAssociationNodeB().isNotNull());
Assert.assertEquals("R9A", association.getAssociationNodeA().getRole());
Assert.assertEquals("R9B", association.getAssociationNodeB().getRole());
Assert.assertFalse(association.getAssociationNodeA().isNavigable());
Assert.assertFalse(association.getAssociationNodeB().isNavigable());
}
use of io.vertigo.dynamo.domain.metamodel.association.AssociationNNDefinition 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);
}
use of io.vertigo.dynamo.domain.metamodel.association.AssociationNNDefinition in project vertigo by KleeGroup.
the class DtObjectUtil method createDtListURIForNNAssociation.
/**
* Récupération d'une URI de Collection à partir d'un dto
* @param entity the entity
* @param associationDefinitionName Nom de l'association
* @param roleName Nom du role
* @return URI de la collection référencée.
*/
public static DtListURIForNNAssociation createDtListURIForNNAssociation(final Entity entity, final String associationDefinitionName, final String roleName) {
Assertion.checkNotNull(associationDefinitionName);
Assertion.checkNotNull(roleName);
Assertion.checkNotNull(entity);
// -----
final AssociationNNDefinition associationDefinition = Home.getApp().getDefinitionSpace().resolve(associationDefinitionName, AssociationNNDefinition.class);
return new DtListURIForNNAssociation(associationDefinition, entity.getURI(), roleName);
}
Aggregations