missing values from database object

From: Lothar Krenzien (lkrenzie..eb.de)
Date: Mon Nov 14 2005 - 08:24:15 EST

  • Next message: Andrus Adamchik: "Re: missing values from database object"

    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
    ______________________________________________________________
    Verschicken Sie romantische, coole und witzige Bilder per SMS!
    Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193



    This archive was generated by hypermail 2.0.0 : Mon Nov 14 2005 - 08:24:19 EST