Hi,

I am not shure if I am talking about the same problem as Dieter Cailliau,
"Re: [castor-dev] class has relation to itself" (I could not find it in the
archive ?!) and http://castor.exolab.org/list-archive/msg11862.html

My class is defined as follows:

public class Keyword {
        /*** this ***/
        private String keyword          = null;
        public String uid                       = null;
        /*** relations ***/
        public ArrayList urls           = new ArrayList();
        public ArrayList predecessors   = new ArrayList();
        public ArrayList successors     = new ArrayList();
}

The insert work fine for the following:

Keyword keyword1 = new Keyword();
keyword1.setKeyword("Programmierung");

Keyword keyword2 = new Keyword();
keyword2.setKeyword("Java");
keyword1.addSuccessor(keyword2);
keyword2.addPredecessor(keyword1);

Keyword keyword3 = new Keyword();
keyword3.setKeyword("Datenbanken");
keyword2.addSuccessor(keyword3);
keyword3.addPredecessor(keyword2);

db.create((Object)keyword1);
db.create((Object)keyword2);
db.create((Object)keyword3);

When I want to read from the database with:

_jdo = new JDO();
_jdo.setDatabaseName("InfoNet");
db = _jdo.getDatabase();
query = db.getOQLQuery( "SELECT object FROM com.debis.urlAdmin.dm.Keyword
object where object.keyword = $1" );
query.bind("Programmierung");

I get the following exception:

org.exolab.castor.jdo.PersistenceException: Nested error:
java.sql.SQLException: Table not found: NULL in statement

[SELECT
keyword.uid,keyword.keyword,urlkeyword.url,keywordkeyword.predecessor,keywor
dkeyword.successor FROM     keyword LEFT OUTER JOIN urlkeyword ON
keyword.uid=urlkeyword.keyword LEFT OUTER JOIN keywordkeyword ON
keyword.uid=keywordkeyword.successor LEFT OUTER JOIN null keywordkeyword ON
keyword.uid=keywordkeyword.predecessor  WHERE (keyword.keyword =
'Programmierung')]

while executing SELECT
keyword.uid,keyword.keyword,urlkeyword.url,keywordkeyword.predecessor,keywor
dkeyword.successor FROM {oj keyword LEFT OUTER JOIN urlkeyword ON
keyword.uid=urlkeyword.keyword LEFT OUTER JOIN keywordkeyword ON
keyword.uid=keywordkeyword.successor LEFT OUTER JOIN null keywordkeyword ON
keyword.uid=keywordkeyword.predecessor} WHERE (keyword.keyword = ?)

My other many to many relations work fine ! So it should be a bug in Castor.

Could somebody who is more familiar with castor provide a bug-fix ?

Boerries

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to