Yes it should throw an exception
Gavin King wrote:
Oh, this is probably because you expect it to be an @JoinColumn. Still,
it should either work, or throw an exception.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gavin
King
Sent: Sunday, March 26, 2006 7:27 PM
To: Emmanuel Bernard
Cc: Hibernate development
Subject: [Hibernate] @Column(insertable=false, updatable=false) is
broken
The following mapping:
@Id
@Column(name="blog_name")
private String blogName;
@OneToOne
@Column(insertable=false, updatable=false)
private Blog blog;
Throws:
Caused by: org.hibernate.MappingException: Repeated column in mapping
for entity: domain.HitCount column: blog_name (should be mapped with
insert="false" update="false")
at
org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentC
lass.java:575)
at
org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(Per
sistentClass.java:597)
at
org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentC
lass.java:615)
at
org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:405)
at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
at
org.hibernate.cfg.Configuration.validate(Configuration.java:984)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1
169)
at
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Config
uration.java:414)
at
org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Confi
guration.java:575)
at
org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(
Ejb3Configuration.java:245)
at
org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFacto
ry(HibernatePersistence.java:108)
at
org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDep
loyment.java:260)
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language that extends applications into web and mobile media. Attend the
live webcast and join the prime developer group breaking into this new
coding territory!
http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
_______________________________________________
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel