Problem by Updating an Object

From: Kai Michael Bodach (
Date: Tue Feb 10 2004 - 06:34:25 EST

  • Next message: Stephen Adams: "Openbase"

    Hi Cayenne users,

    I have a strange problem when I'm using cayenne. I'm a newbie and the cause
    could be the configuration or the way I use cayenne. What I try, is to
    update a exist Object (I think the right term is ObjEntity???). Ok, I have
    load the object via SelectQuery from the db (oracle). I got my object
    (CayenneDataObject) and cast it to my Type. Then I use the setMethod to
    change a property, e.g. a discription property (String). So far so good.
    When I now commit my changes, via dataContext.commitChanges(), I got the
    following Exception:
    [v.1.0.6 January 26 2004] Class
    '' does not map to an ObjEntity
    and is therefore not persistent. Can't commit changes.

    So, I have checked my configuration at runtime and I tryed to figured out
    what map are there. I take the context and called the getDataMaps()-Method
    and I've got the right DataMap (I've checked the name via map.getName()).
    Then I called the getObjectEntityMap() and logged all out, the ClassName,
    the JavaClass and the Name. All seems to be ok. It exists a ObjEntity with
    the name "WopRecht", the class of this entity is
    "", the super class is
    "" ... let say it again it
    seems all ok. But why can't cayenne find the map to my ObjEntity ??? I hope
    anybody can help and pull me out of my confusion, I really checked all, I
    don't know what it can be. Here is a snippet of my map file:


    <?xml version="1.0" encoding="utf-8"?>
    <data-map project-version="1.0">
            <db-entity name="WOP_RECHT">
                    <db-attribute name="ACCESS_RIGHT_CLASS" type="VARCHAR"
                    <db-attribute name="BESCHR_RECHT" type="VARCHAR"
                    <db-attribute name="BEZ_RECHT" type="VARCHAR" length="100"/>
                    <db-attribute name="ID_DIENSTTYP" type="INTEGER"
    isPrimaryKey="true" isMandatory="true" length="22"/>
                    <db-attribute name="ID_RECHT" type="INTEGER"
    isMandatory="true" length="22"/>
                    <db-attribute name="ID_RESOURCE" type="INTEGER"
    isPrimaryKey="true" isMandatory="true" length="22"/>
                    <db-attribute name="P_ID" type="INTEGER" isPrimaryKey="true"
    isMandatory="true" length="22"/>
                    <db-attribute name="RECHTE_FLAG" type="INTEGER"
            <obj-entity name="WopRecht"
                    <obj-attribute name="accessRightClass"
    type="java.lang.String" db-attribute-path="ACCESS_RIGHT_CLASS"/>
                    <obj-attribute name="beschrRecht" type="java.lang.String"
                    <obj-attribute name="bezRecht" type="java.lang.String"
                    <obj-attribute name="idRecht" type="java.lang.Integer"
                    <obj-attribute name="rechteFlag" type="java.lang.Integer"
            <db-relationship name="toWopDiensttyp" source="WOP_RECHT"
    target="WOP_DIENSTTYP" toDependentPK="false"
                    <db-attribute-pair source="ID_DIENSTTYP"
            <db-relationship name="toWopGroup" source="WOP_RECHT"
    target="WOP_GROUP" toDependentPK="false" toMany="false">
                    <db-attribute-pair source="P_ID" target="P_ID"/>
            <db-relationship name="toWopRessource" source="WOP_RECHT"
    target="WOP_RESSOURCE" toDependentPK="false" toMany="false">
                    <db-attribute-pair source="ID_RESOURCE"
            <obj-relationship name="toWopDiensttyp" source="WopRecht"
    target="WopDiensttyp" toMany="false">
                    <db-relationship-ref source="WOP_RECHT"
    target="WOP_DIENSTTYP" name="toWopDiensttyp"/>
            <obj-relationship name="toWopGroup" source="WopRecht"
    target="WopGroup" toMany="false">
                    <db-relationship-ref source="WOP_RECHT" target="WOP_GROUP"
            <obj-relationship name="toWopRessource" source="WopRecht"
    target="WopRessource" toMany="false">
                    <db-relationship-ref source="WOP_RECHT"
    target="WOP_RESSOURCE" name="toWopRessource"/>



    This archive was generated by hypermail 2.0.0 : Tue Feb 10 2004 - 06:36:01 EST