@javax.persistence.Entity
@org.javers.core.metamodel.annotation.ValueObject
class AmbiguousValueObjectType {
@Id int id
}
@javax.persistence.Embeddable
@org.javers.core.metamodel.annotation.Entity
class AmbiguousEntityType {
@Id int id
}
def "should use javers type annotations first, when ambiguous type mapping"(){
expect:
typeFactory.inferFromAnnotations(AmbiguousEntityType) instanceof EntityType
typeFactory.inferFromAnnotations(AmbiguousValueObjectType) instanceof ValueObjectType
}