[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-527) reference a target entity (in a collection) by entity name

Celso Gomes Barreto Jr (JIRA) noreply at atlassian.com
Mon Jun 11 09:17:04 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27198 ] 

Celso Gomes Barreto Jr commented on ANN-527:
--------------------------------------------

In hbm.xml files you can specify the target entity name in a relationship. I don't know why shouldn't you be able to do this using annotations.

I have a class on my application which I reuse as several entities, mapping it with different entity names stored in different tables. I'm still looking for a solution to do the relationship mappings using annotations.

My team is skilled at the use of annotations and when they have to do the mapping using hbm.xml files, they find it very difficult.

> reference a target entity (in a collection) by entity name
> ----------------------------------------------------------
>
>                 Key: ANN-527
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-527
>             Project: Hibernate Annotations
>          Issue Type: New Feature
>          Components: binder
>            Reporter: Armin Haaf
>
> It is only possible to reference a targetEntity by class.
> @ManyToMany(targetEntity = TestImpl.class)
> List<Test> myList;
> This makes it impossible to exchange TestImpl.class implemention by another implemention by the mappings definition.
> It would be helpful to reference a targetEntity by name.
> @ManyToMany(targetEntityName = "Test")
> This would help a lot to implement moduls and frameworks.
> Another way to support this would be to search for a implementation of the collection elements (which are typically Interfaces) in the mapped entities 

-- 
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