[hibernate-issues] [Hibernate-JIRA] Commented: (HCANN-8) Hibernate allow to embed non embeddable class

Maillefer Jean-David (JIRA) noreply at atlassian.com
Wed Aug 5 08:43:11 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HCANN-8?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33701#action_33701 ] 

Maillefer Jean-David commented on HCANN-8:
------------------------------------------

Section section "2.1.6 Mapping Defaults for Non-Relationship Fields or Properties" of the spec too.

> Hibernate allow to embed non embeddable class
> ---------------------------------------------
>
>                 Key: HCANN-8
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HCANN-8
>             Project: Hibernate Commons Annotations
>          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