Hi
Sorry to bother you once again, it looks so simple that I have no
idea what I'm doing wrong.
I have ported this small example to 1.2B1 and removed "Client
Superclass" (but we are using it in our project). I tested it on os x
and linux.
The problem persists.
I get two objects room and site to the same context :
Expression expression = ExpressionFactory.matchExp
(CSite.NAME_PROPERTY, "test site");
SelectQuery query = new SelectQuery(CSite.class, expression);
Expression expression2 = ExpressionFactory.matchExp
(CRoom.NAME_PROPERTY, "test room");
SelectQuery query2 = new SelectQuery(CRoom.class, expression2);
List list = context.performQuery(query);
List list2 = context.performQuery(query2);
CSite site = (CSite)list.get(0);
CRoom room = (CRoom)list2.get(0);
I set relationship:
room.setSite(site);
I save the context:
context.commitChanges();
At this point everything looks good. The relationship is set, foreign
key in database is set.
Than in separate context I fetch the room again:
List list2 = context2.performQuery(query2);
CRoom room = (CRoom)list2.get(0);
And hit the problem ...
room.getSite() is null
I updated the zipped example to work with 1.2B1 (http://
smokidwa.freeshell.org/work/test.zip).
Marcin
On 08/04/2006, at 8:34 PM, Andrus Adamchik wrote:
Marcin,
I ported your test to B1 and ran it on my machine - it works
without any errors. Can you confirm whether this is still a problem?
BTW, I noticed one minor thing in the mapping - you should not
populate "Client Superclass" field. This field is for the "wedge"
class that may optionally be inserted in the inheritance hierarchy
between cayenne.Persistent and _MyObject.
Andrus
On Mar 28, 2006, at 2:49 AM, Marcin Skladaniec wrote:
Hello
I tried with cayenne 1.2M12 but have the same problem.
Here is a small project based on the 3t example from sandbox
reproducing the malfunction I'm seeing. (http://
smokidwa.freeshell.org/work/test.zip)
all jars needed to run project are on http://
smokidwa.freeshell.org/work/
Marcin
On 27/03/2006, at 5:56 PM, Tore Halset wrote:
On Mar 19, 2006, at 23:48, Marcin Skladaniec wrote:
I created a brand new project and I'm still having this problem.
Double-checked out the relations, the data types are matching.
I have done some more testing and found that one-to-many and
many-to-many flattened relations work. That is only many-to-one
that not works.
What else can be wrong ?
Can you create a small test-project to reproduce this behaviour?
It will make it easier for us to help out.
- Tore.
-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001 fax +61 2 9550 4001
-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001 fax +61 2 9550 4001