org.objectstyle.cayenne.CayenneRuntimeException

From: Emre Yilmaz (emre.yilma..tr.com.tr)
Date: Tue Apr 19 2005 - 03:16:21 EDT

  • Next message: tnaki..ofthome.net: "modeler suggestion"

    Hi,
    I want to get PK for entity criticalLevel of ErrorLevel table. But I get an exception (PK is not a number) for the below code. I define the PK Id: Decimal in DbEntity, BigInteger in ObjectEntity. Can anybody help me.

    Thanks.

    Code :
    criticalLevel= "UYARI";
    ErrorLevel level = (ErrorLevel)context.registeredObject(
                new ObjectId(ErrorLevel.class,"criticalLevel", criticalLevel));
             
    int levelID = DataObjectUtils.intPKForObject(level);****EXCEPTION THROWS*****

    Exception:
    org.objectstyle.cayenne.CayenneRuntimeException: [v.1.1RC2 October 24 2004] PK is not a number: tr.com.htr.hgys.db.ErrorLevel: <criticalLevel: UYARI>
        at org.objectstyle.cayenne.DataObjectUtils.intPKForObject(DataObjectUtils.java:97)
        at tr.com.htr.hgys.db.ErrorLogs.setErrorLogs(ErrorLogs.java:26)
        at tr.com.htr.hgys.db.create.CreateDb.main(CreateDb.java:74)



    This archive was generated by hypermail 2.0.0 : Tue Apr 19 2005 - 03:20:23 EDT