Re: Cayenne newbe question

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Jan 14 2005 - 09:27:57 EST

  • Next message: Alexander Lamb: "Some architecture thoughts and questions (somewhat long...)"

    Here is the source code of CayenneDataObject:

    Line 574: ObjEntity objEntity =
    getDataContext().getEntityResolver().lookupObjEntity(this);

    Line 575: ExtendedTypeMap types = getDataContext()
                    .lookupDataNode(objEntity.getDataMap())
                    .getAdapter()
                    .getExtendedTypes();

    So DataContext is not null. You need to figure what else can be null. It
    is either DataNode or ObjEntity. Do you have a DataNode created in the
    Modeler?

    Andrus

    > I created a Model and generated source and schema using CayenneModeler
    > without any problem. Next a wrote a simple test using eclipse 3.x and
    > when I message dContext.commitChanges(org.apache.log4j.Level.ALL); I get
    > the following exception.
    >
    > java.lang.NullPointerException
    > at
    > org.objectstyle.cayenne.CayenneDataObject.validateForSave(CayenneDataObject.java:575)
    > at
    > org.objectstyle.cayenne.CayenneDataObject.validateForInsert(CayenneDataObject.java:700)
    > at
    > org.objectstyle.cayenne.access.ObjectStore.validateUncommittedObjects(ObjectStore.java:937)
    > at
    > org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1260)
    >
    > Is this a model issue or a configuration issue? My classpath looks like
    > C:\eclipse3\workspace\MyProject\build;C:\eclipse3\workspace\MyProject\libs\cayenne.jar.
    > I copied cayenne.xml and my map into ...\MyProject\build.
    >
    > J.R.



    This archive was generated by hypermail 2.0.0 : Fri Jan 14 2005 - 09:27:58 EST