Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

mock exam about isIdentical

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For 2 Entity Bean objects with the same primary key but from different homes, will isIdentical() return true or false?

I think it should be false.

deep
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right.
Amol.
 
Bartender
Posts: 3791
40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure,

it is like have

PK1 = Integer(1)
PK2 = Integer(1)

PK1 equals to PK2

and

EJB1 = AddressBean (has the PK1 key)
EJB2 = PersonBean (has the PK2 key)

EJB1 is not identical to EJB2.

regards,
MZ
[ March 24, 2005: Message edited by: Mikalai Zaikin ]
 
Deep Chand
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mikalai,

Correct but when I said 'same home', I meant same entity bean type i.e. both the objects are of PersonBean but from different homes. I have this doubt because if a bean is deployed twice, each will have a different home.

Please reply.
Deep
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both of them must come from same home and should be pointing towards the same entity. By Entity, i mean , Primary Key's object data that uniquly identifies it in the database. For example Bean 1(#88) ,Bean 2 (#88) , Bean 3 (#98), Bean 4(#299) . Consider these are all beans with primary key values in parenthesis. When you run isIdentical on Bean 1 and 2 , it should return true bcaz Bean 1 and 2 are sharing the same primary key object. For all others it will return false. I assume all of them are coming from the same home.
 
This is my favorite tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic