This week's book giveaway is in the Agile forum.
We're giving away four copies of Fixing your Scrum and have Ryan Ripley & Todd Miller on-line!
See this thread for details.
Win a copy of Fixing your Scrum this week in the Agile 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Discriminator column not accessible

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone

in @inheritance type Joined

I have class person, employee and Student

i have common columns in Person , and getters setters for discriminator column if i have to access it from person class



so when i am saving the Employee or Student record and then retrieving Person record, It is giving me discriminator column value as NULL
but after restarting the server its giving me value accordingly

if i manually set the value of discriminator column value and then save and retrieve then its giving me the value (Do i need to manaully set the discriminator column value?)
then what is benefit of using discriminator column

why should i not use OneToMany relation of person with employee and student having column Type and via enum i can enter the perspective value into the column
and i will also apply lazy fetching on that columns

Please Suggest

Thanks In Advance
Ramandeep Singh
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please edit your post and UseCodeTags.
 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Do i need to manaully set the discriminator column value?



No. Not when you are using it properly.


The inheritance strategy you have chosen does not use a discriminator.
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic