CDO and generated model Impl [message #67271] |
Mon, 08 January 2007 14:49 |
Eclipse User |
|
|
|
Originally posted by: yannick.lizzi.silogic.fr
Hi (again)
I have a question regarding the generated code for CDO model.
The multiple associations (aggregation or not) are generated as follow:
public EList getMyChildren() {
cdoLoad();
if (children == null) (
// init children
...
}
return children;
}
But in case of simple association, the generated code is as follow:
public Children getMyChildren() {
if (children != null && children.isProxy()) {
// resolving proxy
...
}
return children;
}
My question is: why the generated getter does not start with cdoLoad()
in the simple relation case?
This leads to problems (in my code at least): when I load my object
model via some container classes, I call getMyChildren() where I know
there is a children (confirmed also by the database content) and this
result to a null value.
Of course if I invoke cdoLoad() before each call of getMyChildren()
(either in my impl code or in the calling code) it works but I was
thinking of something more automatic if not direcly generated.
Yannick
|
|
|
Re: CDO and generated model Impl [message #67284 is a reply to message #67271] |
Mon, 08 January 2007 15:50 |
Eclipse User |
|
|
|
Originally posted by: stepper.sympedia.de
Hi Yannick,
I believe that this has been fixed in the context of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=162961
The changes are committed to the R0_7_maintenance branch. Unfortunately
I can't publish a new build right now due to an issue with the build system.
If you don't want to checkout from CVS, you can also try to change the
following files to only contain "cdoLoad();"
/org.eclipse.emf.cdo.client/templates/model/Class/getGenFeat ure.pre.insert.javajetinc
/org.eclipse.emf.cdo.client/templates/model/Class/setGenFeat ure.pre.insert.javajetinc
and regenerate your models!
Does this help?
Cheers
/Eike
Yannick Lizzi schrieb:
> Hi (again)
>
> I have a question regarding the generated code for CDO model.
>
> The multiple associations (aggregation or not) are generated as follow:
>
> public EList getMyChildren() {
> cdoLoad();
> if (children == null) (
> // init children
> ...
> }
> return children;
> }
>
> But in case of simple association, the generated code is as follow:
>
> public Children getMyChildren() {
> if (children != null && children.isProxy()) {
> // resolving proxy
> ...
> }
> return children;
> }
>
> My question is: why the generated getter does not start with cdoLoad()
> in the simple relation case?
> This leads to problems (in my code at least): when I load my object
> model via some container classes, I call getMyChildren() where I know
> there is a children (confirmed also by the database content) and this
> result to a null value.
>
> Of course if I invoke cdoLoad() before each call of getMyChildren()
> (either in my impl code or in the calling code) it works but I was
> thinking of something more automatic if not direcly generated.
>
> Yannick
|
|
|
Re: CDO and generated model Impl [message #67313 is a reply to message #67284] |
Mon, 08 January 2007 16:44 |
Eclipse User |
|
|
|
Originally posted by: yannick.lizzi.silogic.fr
Hi Eike
OK I was indeed working with the R0_7_maintenance version, but I did not
regenerate the model.
Now I see the cdoLoad() methods everywhere.
Thanks
Yannick
Eike Stepper a écrit :
> Hi Yannick,
>
> I believe that this has been fixed in the context of
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=162961
> The changes are committed to the R0_7_maintenance branch. Unfortunately
> I can't publish a new build right now due to an issue with the build
> system.
>
> If you don't want to checkout from CVS, you can also try to change the
> following files to only contain "cdoLoad();"
>
> /org.eclipse.emf.cdo.client/templates/model/Class/getGenFeat ure.pre.insert.javajetinc
>
>
> /org.eclipse.emf.cdo.client/templates/model/Class/setGenFeat ure.pre.insert.javajetinc
>
>
> and regenerate your models!
> Does this help?
>
> Cheers
> /Eike
>
>
> Yannick Lizzi schrieb:
>> Hi (again)
>>
>> I have a question regarding the generated code for CDO model.
>>
>> The multiple associations (aggregation or not) are generated as follow:
>>
>> public EList getMyChildren() {
>> cdoLoad();
>> if (children == null) (
>> // init children
>> ...
>> }
>> return children;
>> }
>>
>> But in case of simple association, the generated code is as follow:
>>
>> public Children getMyChildren() {
>> if (children != null && children.isProxy()) {
>> // resolving proxy
>> ...
>> }
>> return children;
>> }
>>
>> My question is: why the generated getter does not start with cdoLoad()
>> in the simple relation case?
>> This leads to problems (in my code at least): when I load my object
>> model via some container classes, I call getMyChildren() where I know
>> there is a children (confirmed also by the database content) and this
>> result to a null value.
>>
>> Of course if I invoke cdoLoad() before each call of getMyChildren()
>> (either in my impl code or in the calling code) it works but I was
>> thinking of something more automatic if not direcly generated.
>>
>> Yannick
|
|
|
Re: CDO and generated model Impl [message #600891 is a reply to message #67271] |
Mon, 08 January 2007 15:50 |
|
Hi Yannick,
I believe that this has been fixed in the context of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=162961
The changes are committed to the R0_7_maintenance branch. Unfortunately
I can't publish a new build right now due to an issue with the build system.
If you don't want to checkout from CVS, you can also try to change the
following files to only contain "cdoLoad();"
/org.eclipse.emf.cdo.client/templates/model/Class/getGenFeat ure.pre.insert.javajetinc
/org.eclipse.emf.cdo.client/templates/model/Class/setGenFeat ure.pre.insert.javajetinc
and regenerate your models!
Does this help?
Cheers
/Eike
Yannick Lizzi schrieb:
> Hi (again)
>
> I have a question regarding the generated code for CDO model.
>
> The multiple associations (aggregation or not) are generated as follow:
>
> public EList getMyChildren() {
> cdoLoad();
> if (children == null) (
> // init children
> ...
> }
> return children;
> }
>
> But in case of simple association, the generated code is as follow:
>
> public Children getMyChildren() {
> if (children != null && children.isProxy()) {
> // resolving proxy
> ...
> }
> return children;
> }
>
> My question is: why the generated getter does not start with cdoLoad()
> in the simple relation case?
> This leads to problems (in my code at least): when I load my object
> model via some container classes, I call getMyChildren() where I know
> there is a children (confirmed also by the database content) and this
> result to a null value.
>
> Of course if I invoke cdoLoad() before each call of getMyChildren()
> (either in my impl code or in the calling code) it works but I was
> thinking of something more automatic if not direcly generated.
>
> Yannick
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: CDO and generated model Impl [message #600919 is a reply to message #67284] |
Mon, 08 January 2007 16:44 |
Eclipse User |
|
|
|
Originally posted by: yannick.lizzi.silogic.fr
Hi Eike
OK I was indeed working with the R0_7_maintenance version, but I did not
regenerate the model.
Now I see the cdoLoad() methods everywhere.
Thanks
Yannick
Eike Stepper a écrit :
> Hi Yannick,
>
> I believe that this has been fixed in the context of
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=162961
> The changes are committed to the R0_7_maintenance branch. Unfortunately
> I can't publish a new build right now due to an issue with the build
> system.
>
> If you don't want to checkout from CVS, you can also try to change the
> following files to only contain "cdoLoad();"
>
> /org.eclipse.emf.cdo.client/templates/model/Class/getGenFeat ure.pre.insert.javajetinc
>
>
> /org.eclipse.emf.cdo.client/templates/model/Class/setGenFeat ure.pre.insert.javajetinc
>
>
> and regenerate your models!
> Does this help?
>
> Cheers
> /Eike
>
>
> Yannick Lizzi schrieb:
>> Hi (again)
>>
>> I have a question regarding the generated code for CDO model.
>>
>> The multiple associations (aggregation or not) are generated as follow:
>>
>> public EList getMyChildren() {
>> cdoLoad();
>> if (children == null) (
>> // init children
>> ...
>> }
>> return children;
>> }
>>
>> But in case of simple association, the generated code is as follow:
>>
>> public Children getMyChildren() {
>> if (children != null && children.isProxy()) {
>> // resolving proxy
>> ...
>> }
>> return children;
>> }
>>
>> My question is: why the generated getter does not start with cdoLoad()
>> in the simple relation case?
>> This leads to problems (in my code at least): when I load my object
>> model via some container classes, I call getMyChildren() where I know
>> there is a children (confirmed also by the database content) and this
>> result to a null value.
>>
>> Of course if I invoke cdoLoad() before each call of getMyChildren()
>> (either in my impl code or in the calling code) it works but I was
>> thinking of something more automatic if not direcly generated.
>>
>> Yannick
|
|
|
Powered by
FUDForum. Page generated in 0.03585 seconds