[hibernate-issues] [Hibernate-JIRA] Moved: (HHH-4983) Hibernate allow to embed non embeddable class

Emmanuel Bernard (JIRA) noreply at atlassian.com
Tue Mar 9 08:11:47 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bernard moved HCANN-8 to HHH-4983:
-------------------------------------------

        Key: HHH-4983  (was: HCANN-8)
    Project: Hibernate Core  (was: Hibernate Commons Annotations)

> Hibernate allow to embed non embeddable class
> ---------------------------------------------
>
>                 Key: HHH-4983
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4983
>             Project: Hibernate Core
>          Issue Type: Bug
>         Environment: JBoss-5.1.0.GA, postgresql 8.4.0
>            Reporter: Maillefer Jean-David
>            Priority: Minor
>
> Hibernate allows to embed  (successfully !)  a non embeddable class (if it was embeddable,  it would throw a compiler exception)
> @Entity
> public class BanqueId {
> 	@Id
> 	int id;
> }
> public class Compte{
> 	@ManyToOne
> 	@JoinColumn(name = "compte_banqueId_id", insertable = false, updatable = false)
> 	private BanqueId banqueId;
> 	@Column(name = "compte_iban", length = 30)
> 	private String iban;
> }
> @Entity
> public class Cotisation {
> 	@Id
> 	int id;
> 	@Embedded
> 	private Compte compte;
> }
> In this case, using @Embeddable on Compte yields the following compiler error: "Attribute "banqueId" has invalid mapping type in this context"
> Not using this annotation (as in this example) generates (at least partially) working code, but seems not to follow the specification (ejb 3.0 spec persistance, 9.1.35) !

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