[hibernate-issues] [Hibernate-JIRA] Updated: (ANN-28) @Any
Alexander Portnov (JIRA)
noreply at atlassian.com
Sat Nov 11 16:59:05 EST 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-28?page=all ]
Alexander Portnov updated ANN-28:
---------------------------------
Attachment: annotations-any-patch2.txt
Added @MetaData annotation to avoid duplicate @MetaValue mappings on every property of the same type. @MetaData allows to specify mappings only once on the Interface itself. Also added metaDataClass attribute to @Any and @ManyToAny annotations. This is useful when property declaration uses generics.
For example:
public class PropertyList<T extends Property> {
private T someProperty;
...
@Any(idType="integer", metaType="string",
columns = {
@Column(name="property_type"),
@Column(name="property_id")},
metaDataClass = Property.class,
cascade= CascadeType.ALL)
public T getSomeProperty() {
return someProperty;
}
}
Where Property is mapped as following:
@MetaData({
@MetaValue(value="S", targetEntity=StringProperty.class),
@MetaValue(value="I", targetEntity=IntegerProperty.class)
})
public interface Property {
public String getName();
public String asString();
}
> @Any
> ----
>
> Key: ANN-28
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-28
> Project: Hibernate Annotations
> Type: Patch
> Components: binder
> Versions: 3.1beta3
> Reporter: Emmanuel Bernard
> Priority: Trivial
> Attachments: annotations-any-patch.txt, annotations-any-patch2.txt
>
>
> @AnyValue(value="", class="") //or MetaValue?
> @Any(idType="", metaType="", metaValues={@MetaValue()}, columns={@Column()})
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list