cardinality.isSingle() problem with Astah anycode-plugin

Issue #13 resolved
Randal Peters
created an issue

For relation attributes it seems that cardinality.isSingle() does not always return the proper result for various valid cardinality specifications. I find this method useful when generating code for MVC foreign key data annotations.

Here is a summary of my tests. I've attached a zip of the simple tests I did.

Relation attributes on model that produce CORRECT value for cardinality.isSingle()

0..1 0.. 1.. 1

Relation attributes on model that produce INCORRECT value for cardinality.isSingle()

2 (any single value > 1) (shorthand for 0..) 2..9 (any range with max > 1) 2..* (any range with min > 1)

Comments (2)

  1. j repo owner

    Cardinality fixed and also isSingle method. Now there are more cardinalities defined (more accurate) : ZERO_TO_ONE ONE_TO_ONE ZERO_TO_MANY ONE_TO_MANY ANY_TO_MANY (.., with lower can be 0) MANY_TO_MANY (n..*, with n > 1)

  2. Log in to comment