• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

mock exam about isIdentical

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
You are right.
Amol.
 
Rancher
Posts: 3620
38
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic