• 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
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Doubt - Oreilly - Page 107

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

Plesae refer Oreilly - Page 107

All the three things - pkColumnName valueColumnName pkColumnValue are confusing me.

Functionally, what is the difference between these three.

It would be great if some one draws a relevant table here and explains me
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Niranjan Deshpande:
Hi all,

Plesae refer Oreilly - Page 107

All the three things - pkColumnName valueColumnName pkColumnValue are confusing me.

Functionally, what is the difference between these three.

It would be great if some one draws a relevant table here and explains me



The schema is simple as a pie.

Have a look at the following table:



So, the layout is:
pkColumnName = "PK_COLUMN"
valueColumnName = "VALUE_COLUMN"
pkColumnValue = "DETERMINANT2" (for example)

The idea is each row in the table represents certain entity and there must be the way to distinguish between entities (3 entities in the preceding example)
[ February 09, 2008: Message edited by: Alex Kikhtenko ]
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for that..

But its still unclear to me !!

Please explain the schema keeping in mind the example entiy in oreilly.
Will be grateful

What is the CUST_ID in the Oreilly code? Please explain the schema with reference to the code in the book
 
Alex Kikhtenko
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. Let's consider the book's example with Customer entity.



Suppose we have another one entity Product:


As you can see we want the both entities to use the same table GENERATOR_TABLE to hold their Primary-Key-Next-Value.

Suppose also we've just persisted 3 Customer entities and 8 Product entities into the DB.

In this case the GENERATOR_TABLE table would look like:


So obviously CUST_ID is necessary to distinguish it's primary key value from primery key value of Product entity bean.

Hope this helps.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic