The Collection (DList which is changeable from the OJB.properties) DOES contain a User object.


On Friday, March 21, 2003, at 12:38 PM, Edson Carlos Ericksson Richter wrote:


Hi!

Table:
UsersTable (id, username, password) -> mapped to User object with same
properties.
where id is Primary Key, and username is a unique key.


Well, if I query "select user from User where username = $1 and password =
$2", ODMG will always return a collection when I issue query.execute()? Or
it should detect that has only one object, and return a User object?


Just get from API doc for OQLQuery:
"The object that represents the result of the query. The returned data,
whatever its OQL type, is encapsulated into an object. For instance, when
OQL returns an integer, the result is put into an Integer object. When OQL
returns a collection (literal or object), the result is always a Java
collection object of the same kind (for instance, a DList). "


Appear to me that when OQL returns an User, the result should be put into
User object, as in "For instance, when OQL returns an integer, the result is
put into an Integer object".



Thanks for any clarification.


Edson Richter



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.463 / Virus Database: 262 - Release Date: 17/3/2003
<smime.p7s>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to