Hi,
I'm trying to access the AttributeOverrides annotation with AttributeOverride annotation like:
@AttributeOverrides({
@AttributeOverride(name="street",
column=@Column(name="ADDR_street")),
[...]
})
@Embedded Address address;
but it looks like
@AttributeOverrides({ "street", "no", "zip" })
@Embedded
private Address address;
Maybe someone here can give me a hint on how to do this? I think the problem is my operator ("val op = a.annotation.members."...), because it changes nothing if I remove these lines.
A part from the ModelInferrer:
members += property.toField( property.name, property.type) [
val a = property.toAnnotation("javax.persistence.AttributeOverrides")
val v = TypesFactory::eINSTANCE.createJvmStringAnnotationValue
for (EObject t : property.type.type.eContents) {
if (t instanceof JvmFieldImpl) {
val op = a.annotation.members.filter(typeof(JvmOperation)).filter(o|o.simpleName == "name").head
v.operation = op
v.values += (t as JvmFieldImpl).simpleName
a.values += v
}
}
annotations += a
annotations += property.toAnnotation("javax.persistence.Embedded")
]
Thanks in advance for any help!
Tobias
[Updated on: Wed, 07 November 2012 13:15]
Report message to a moderator