ObjectList and Belong To

25 views
Skip to first unread message

mrbar2000

unread,
Feb 18, 2012, 7:29:41 AM2/18/12
to dorm, The Delphi ORM
Hi daniele

When I added belongto to Coc Strategy using Owner as convention I
catch a loop when loading the objects. then I see the mapping file of
sample and I discover somethings that raise some doubts.

Why ObjectList sample Laptop.Owner not is defined as a belong to
relation?
Why Owner was´t putted on laptop fields too?

{
...
"TPerson":
{
"package":"BusinessObjects",
"table": "PEOPLE",
"id": {"name":"ID", "field":"ID", "field_type":"integer"},
...
{"name":"Age", "field":"AGE", "field_type":"integer"}
],
"has_many":[{
"name": "Laptops",
"class_name":"TLaptop",
"child_field_name":"PersonID",
"lazy_load": false
}]
},
"TLaptop":
{
"package":"BusinessObjects",
"table": "LAPTOPS",
"id": {"name":"ID", "field":"ID", "field_type":"integer"},
"fields":[
{"name":"Model", "field":"MODEL", "field_type":"string",
"size": 50},
{"name":"RAM", "field":"RAM", "field_type":"integer"},
{"name":"Cores", "field":"NR_OF_CORES",
"field_type":"integer"},
{"name":"PersonID", "field":"ID_PERSON",
"field_type":"integer"}]
}
}

mrbar2000

unread,
Feb 18, 2012, 7:45:53 AM2/18/12
to dorm, The Delphi ORM
You give me the tip!

The problem is really about LazyLoad in belongto relations. When true
all works
when false generate stack overflow exception.

I think that this is a Dorm bug no?

Daniele Teti

unread,
Feb 18, 2012, 10:39:10 AM2/18/12
to dorm-the-...@googlegroups.com

Yes! With identity map this can be fixed as well. After the session refactoring, I'll reintroduce identity map in dorm.
Bye

--
You received this message because you are subscribed to the Google Groups "dorm, The Delphi ORM" group.
To post to this group, send email to dorm-the-...@googlegroups.com.
To unsubscribe from this group, send email to dorm-the-delphi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dorm-the-delphi-orm?hl=en.

mrbar2000

unread,
Feb 18, 2012, 1:35:26 PM2/18/12
to dorm, The Delphi ORM
Ok i'm working on this session refactoring now! please update your
sources!
Reply all
Reply to author
Forward
0 new messages