• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inheriting properties from superclass

 
Fane Preda
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

In my model I have a series of classes that extend an abstract class named Resource and I want those classes to have mutually exclusive id's (the id being their primary key) because I want to be able to reference any Resource by unique id. I created a sequence in the database (PostgreSQL 8) named "SEQUENCE_GLOBAL_RESOURCE_ID". My code like this:





Example of entity which extends Resource:





Now if I retrieve an Organization, the instance I get has all the fields correct (as in the database) except for id which is 0! Does anyone have any idea why this is happening?

Thanks.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic