• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
She'll be back. I'm just gonna wait here. With this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic