Java 类org.hibernate.annotations.MetaValue 实例源码

项目:elide    文件:Property.java   
@Any(metaColumn = @Column(name = "property_type"))
@AnyMetaDef(idType = "long", metaType = "string", metaValues = {
        @MetaValue(targetEntity = example.Tractor.class, value = "tractor"),
        @MetaValue(targetEntity = example.Smartphone.class, value = "smartphone")
})
@JoinColumn(name = "property_id")
@ToOne
public Device getMyStuff() {
    return myStuff;
}
项目:org.fastnate    文件:EntityProperty.java   
private void fillMetaDefs(final AttributeAccessor attribute, final GeneratorDialect dialect) {
    final AnyMetaDef metaDef = attribute.getAnnotation(AnyMetaDef.class);
    if (metaDef == null) {
        throw new IllegalArgumentException("Missing AnyMetaDef for " + attribute);
    }
    for (final MetaValue metaValue : metaDef.metaValues()) {
        this.anyClasses.put(metaValue.targetEntity(), PrimitiveColumnExpression.create(metaValue.value(), dialect));
    }
}