Hi Lothar,
How do you check that the property is null? By calling "getName()"
method or in some other way?
One possibility is that you are getting an object in HOLLOW
persistence state in one of your cases. If you access property via
the getter, HOLLOW object will be resolved behind the scenes on
demand, however if you are using something like
"readPropertyDirectly", you are bypassing Cayenne faulting mechanism
and can get such "unexpected" results.
Andrus
On Nov 14, 2005, at 4:24 PM, Lothar Krenzien wrote:
>
> Hi there,
>
> I have a database table called 'tblPlant' from which I want to
> retrieved all the values for a specific id. Of course no problem.
> But sometimes not all values are selected. The method in which the
> database object is created, is used from two different classes.
> From the first it works all fine while from the second one some
> values are missing. And because it is the same method call I can't
> find any failures in my code. Does anybody else have seen such a
> problem ?
>
> Here's my code:
>
> DataContext context = getDaoContext(ctx);
> TblPlant plant = (TblPlant)DataObjectUtils.objectForPK(context,
> TblPlant.class, Integer.parseInt(plantId));
>
> For example the name property of the plant object is always null
> while the database doesn't allows null.
>
> The domain map file looks like :
>
> <db-entity name="tblPlant" schema="dbo" catalog="dbTest">
> <db-attribute name="name" type="VARCHAR"
> isMandatory="true" length="100"/>
>
> <obj-entity name="TblPlant" className="back.gen.TblPlant"
> dbEntityName="tblPlant">
> <obj-attribute name="name"
> type="java.lang.String" db-attribute-path="name"/>
>
> And I'm sure that I used the right database connection. Also the
> plantId is set correctly. I'm using MS SQL Server 2000 and Java 1.5
>
> Thanks, Lothar
This archive was generated by hypermail 2.0.0 : Tue Nov 15 2005 - 02:26:37 EST