Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Hibernate: read-only on @Column in embedded ID composite key classes mapping exception - bug?

 
Ranch Hand
Posts: 106
Hibernate Python MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the DB design (DDL):


Here's the Zip class + composite primary key class:


Hibernate stack trace:


What's this? country_code is mapped as read-only (insertable = false, updatable = false) in the composite primary key class. This works perfectly with EclipseLink! IIRC @Embeddable classes allow @Basic, @Column, @Enumerated, @Temporal, @Lob, and @Embedded on its columns, so this should work. Note the code is JPA 1.0 compatible.

The exception vanishes when putting the insertable = false, updatable = false on the @JoinColumn, but this is not what I want. I prefer my associations to be writable...

Is this a Hibernate bug? I'm using Hibernate 3.6 stable.

Karsten
 
Rototillers convert rich soil into dirt. Please note that this tiny ad is not a rototiller:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!