[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-2316) EntityHome#getEntityClass() returns EntityManager.class rather than entity class

Pete Muir (JIRA) jira-events at lists.jboss.org
Thu Jan 3 07:54:43 EST 2008

     [ http://jira.jboss.com/jira/browse/JBSEAM-2316?page=all ]

Pete Muir closed JBSEAM-2316.

    Resolution: Done

It only worked before by chance:

public abstract class NodeHome<N extends WikiNode, P extends WikiNode> extends EntityHome<P> {

public class DocumentHome extends NodeHome<WikiDocument, WikiDirectory> {}

would have guessed the EntityClass as WikiDocument, not WikiDirectory.

So in complex situation's like this you should implement your own getEntityClass() system (perhaps based on generic inference).

I can't see a better way to handle this given type erasure.

> EntityHome#getEntityClass() returns EntityManager.class rather than entity class
> --------------------------------------------------------------------------------
>                 Key: JBSEAM-2316
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2316
>             Project: JBoss Seam
>          Issue Type: Bug
>    Affects Versions: 2.0.0.GA
>            Reporter: Dan Allen
>         Assigned To: Pete Muir
>            Priority: Minor
>             Fix For: 2.0.1.GA
>         Attachments: JBSEAM-2316-v1.txt
>   Original Estimate: 2 hours
>  Remaining Estimate: 2 hours
> This is a strange one. The getEntityClass() is returning the wrong type parameter. It should be returning the first but it is instead returning the second.
> You will discover that this assertion fails.
> assert new EntityHome<SimpleEntity>().getEntityClass() == SimpleEntity.class;

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list