Win a copy of Svelte and Sapper in Action this week 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

List "key Column" and "List Index" values null.

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have this scenarion. One Conference can have many Users. So,
I mapped my Conference class like this :

and my Users class like this :

Now, the Conf_id and the idx columns are being updated as null and .. I have no clue why.



Heres the code that tests the updations:


Any help, greatly appreciated.

Rgds
 
Mike Anna
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Should I have actually mapped Conference in Users mapping as a component or.. may be just modify it into a many to one association.?

have I missed giving any details ?


rgds
[ October 15, 2007: Message edited by: Mike Anna ]
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see a FK mapping of conf_Id in your User class, so how would Hibernate know to put a value into that field?

Also, be careful about id naming and capitalization. I got confused how in User you have "id" to a column called "ID" and in the conference it was "conf_Id", the normal default way, if you can change the database is to call the attribute in the class all lower case "id" and allow Hibernate to automatically combine the class name and id name like Class=Mark and id is "id" Hibernate will give you "mark_id" as the PK field name.

Mark
 
Mike Anna
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark, for replying.
I am fairly new to hibernate.

I don't see a FK mapping of conf_Id in your User class, so how would Hibernate know to put a value into that field?


and how would I do that ?
map the conf_Id as a propertyu in the component mapping of the Users class ?

Right about the naming conventions, I will take care.

Rgds
[ October 15, 2007: Message edited by: Mike Anna ]
 
Everyone is a villain in someone else's story. Especially this devious tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic