Thought inc.

The Dynamic O/R Mapping Company

CocoBase Technical Support Forums
For access to developer site with software download and doc's, please request CocoBase download and password
will be emailed to you. Response to posts will appear when answered by THOUGHT Support team.
NOTE:You must register separately with forum in order to post your questions, please click on register icon below.
Home   Frequently Asked Questions   Search   Edit your profile   Registration is free!  
Email This Page to Someone!
Show a Printable Version
CocoBase Enterprise O/R Forums > CocoBase Bug Reports
FindByPK returns first row if PK is null!!!
< Previous Thread     Next Thread >
Thread    Post New Thread     Post A Reply

Registered: Apr 2001
Posts: 62


I generated a BMP from CocoBase in VAJ 3.5 patch 2 and was testing the same. When i passed the primary key as null in findByPrimaryKey() method, it returned the first row in the database table instead of throwing an exception. Please tell us how do we solve this issue? We might have cases where the primary key might come as null. In that case, we would like the system to raise an error/exception instead of retrieving the first row. Please check it urgently.

05-19-2001 03:20 AM
Click Here to See the Profile for sumit    Find more posts by sumit        Edit/Delete Message    Reply w/Quote    IP: Logged

Registered: Apr 2001
Posts: 19

A null primary key will by default create a wildcard lookup
and find the first record for the EntityBean defined. In
other words this is the 'expected' behavior, although it may
not be the behavior you were looking for.

If you want the EntityBean to behave differently you can
modify either the code generation templates or the resulting
bean to throw an exception if you have a null primary key.

Hope that helps!


05-22-2001 10:30 AM
Click Here to See the Profile for admin    Find more posts by admin        Edit/Delete Message    Reply w/Quote    IP: Logged
All times are PST (US)    Post New Thread     Post A Reply
Forum Jump:
< Previous Thread     Next Thread >

Forum Rules:
Who Can Read The Forum? Any registered user or guest.
Who Can Post New Topics? Any registered user.
Who Can Post Replies? Any registered user.
Changes: Messages can be edited by their author. Messages can be deleted by their author.
Posts: HTML code is OFF. Smilies are OFF. vB code is OFF. [IMG] code is OFF.

Admin Options:
Open / Close Thread
Move Thread
Delete Thread
Edit Thread

< Contact Us - THOUGHT Inc. >

Copyright © Jelsoft Enterprises Limited 2000.
Copyright 2001 All Rights Reserved, THOUGHT Inc.