Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

confused about primary key

 
S Raman
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a trade table which records all share trades done. tradeid is unique and primary key
I have a table inwards which records shares bought from public issue or friends which as no trade id
I have a view which summarises the trade for each day by script id union with inward
can I use this View for session bean there is no primary key
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Session beans are not part of the persistance layer. Did you mean Entity Bean?
 
Emanuel Kadziela
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not have a primary key in the second table? A table without a primary key doesn't belong in a relational database and will almost always cause problems.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think what he wants to map is a view, not a table. And views don't require primary keys.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic