You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Jo...@filternet.nl on 2014/09/16 09:56:41 UTC
1:1 relationship between objects supported in ISIS?
How can I define a one-on-one relationship between objects in ISIS (using JDO)?
I tried to define a key in both objects but didn't succeed... Is there an example somewhere?�
Re: 1:1 relationship between objects supported in ISIS?
Posted by GESCONSULTOR - Óscar Bou <o....@gesconsultor.com>.
Hi all.
I have the following template on Eclipse for 1-1 child properties (for the "parent" property no "special" annotation is needed. Simply a @Column one):
// {{ ${PropertyName} (property)
private ${PropertyType} ${propertyName};
${:import(org.apache.isis.applib.annotation.MemberOrder,javax.jdo.annotations.Column,javax.jdo.annotations.Persistent)}@MemberOrder(sequence="1")
@Column(allowsNull="${trueOrFalse}")
@Persistent(mappedBy="${fieldOnChild}")
public ${PropertyType} get${PropertyName}() {
return ${propertyName};
}
public void set${PropertyName}(final ${PropertyType} ${propertyName}) {
this.${propertyName} = ${propertyName};
}
// }}
It's on the Apache Isis Eclipse Editor templates file [1], named "isjdp-11c" - JDO Property (1:1 child)
HTH,
Oscar
[1] http://isis.apache.org/intro/resources/editor-templates.html
El 16/09/2014, a las 11:52, Dan Haywood <da...@haywood-associates.co.uk> escribió:
> That's true, I'd forgotten about that one.
>
>
>
> On 16 September 2014 10:14, Jeroen van der Wal <je...@stromboli.it> wrote:
>
>> The next and previous pattern we use in Estatio [1] is an example of a 1:1
>> relationship.
>>
>> [1]
>>
>> https://github.com/estatio/estatio/blob/master/dom/src/main/java/org/estatio/dom/lease/LeaseTerm.java#L341-L372
>>
>> On Tue, Sep 16, 2014 at 10:21 AM, Dan Haywood <
>> dan@haywood-associates.co.uk>
>> wrote:
>>
>>> We don't have a 1:1 example in Estatio, but I'm pretty sure I've seen an
>>> example someone else posted that did have one.
>>>
>>> Oscar, do you use 1:1 in your app?
>>>
>>> At any rate, the DataNucleus pages should help [1]
>>>
>>> Cheers
>>> Dan
>>>
>>> [1]
>>> http://www.datanucleus.org/products/datanucleus/jdo/orm/one_to_one.html
>>>
>>>
>>> On 16 September 2014 08:56, <Jo...@filternet.nl> wrote:
>>>
>>>>
>>>>
>>>> How can I define a one-on-one relationship between objects in ISIS
>> (using
>>>> JDO)?
>>>>
>>>> I tried to define a key in both objects but didn't succeed... Is there
>> an
>>>> example somewhere?
>>>>
>>>>
>>>>
>>>>
>>>
>>
Re: 1:1 relationship between objects supported in ISIS?
Posted by Dan Haywood <da...@haywood-associates.co.uk>.
That's true, I'd forgotten about that one.
On 16 September 2014 10:14, Jeroen van der Wal <je...@stromboli.it> wrote:
> The next and previous pattern we use in Estatio [1] is an example of a 1:1
> relationship.
>
> [1]
>
> https://github.com/estatio/estatio/blob/master/dom/src/main/java/org/estatio/dom/lease/LeaseTerm.java#L341-L372
>
> On Tue, Sep 16, 2014 at 10:21 AM, Dan Haywood <
> dan@haywood-associates.co.uk>
> wrote:
>
> > We don't have a 1:1 example in Estatio, but I'm pretty sure I've seen an
> > example someone else posted that did have one.
> >
> > Oscar, do you use 1:1 in your app?
> >
> > At any rate, the DataNucleus pages should help [1]
> >
> > Cheers
> > Dan
> >
> > [1]
> > http://www.datanucleus.org/products/datanucleus/jdo/orm/one_to_one.html
> >
> >
> > On 16 September 2014 08:56, <Jo...@filternet.nl> wrote:
> >
> > >
> > >
> > > How can I define a one-on-one relationship between objects in ISIS
> (using
> > > JDO)?
> > >
> > > I tried to define a key in both objects but didn't succeed... Is there
> an
> > > example somewhere?
> > >
> > >
> > >
> > >
> >
>
Re: 1:1 relationship between objects supported in ISIS?
Posted by Jeroen van der Wal <je...@stromboli.it>.
The next and previous pattern we use in Estatio [1] is an example of a 1:1
relationship.
[1]
https://github.com/estatio/estatio/blob/master/dom/src/main/java/org/estatio/dom/lease/LeaseTerm.java#L341-L372
On Tue, Sep 16, 2014 at 10:21 AM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:
> We don't have a 1:1 example in Estatio, but I'm pretty sure I've seen an
> example someone else posted that did have one.
>
> Oscar, do you use 1:1 in your app?
>
> At any rate, the DataNucleus pages should help [1]
>
> Cheers
> Dan
>
> [1]
> http://www.datanucleus.org/products/datanucleus/jdo/orm/one_to_one.html
>
>
> On 16 September 2014 08:56, <Jo...@filternet.nl> wrote:
>
> >
> >
> > How can I define a one-on-one relationship between objects in ISIS (using
> > JDO)?
> >
> > I tried to define a key in both objects but didn't succeed... Is there an
> > example somewhere?
> >
> >
> >
> >
>
Re: 1:1 relationship between objects supported in ISIS?
Posted by Dan Haywood <da...@haywood-associates.co.uk>.
We don't have a 1:1 example in Estatio, but I'm pretty sure I've seen an
example someone else posted that did have one.
Oscar, do you use 1:1 in your app?
At any rate, the DataNucleus pages should help [1]
Cheers
Dan
[1] http://www.datanucleus.org/products/datanucleus/jdo/orm/one_to_one.html
On 16 September 2014 08:56, <Jo...@filternet.nl> wrote:
>
>
> How can I define a one-on-one relationship between objects in ISIS (using
> JDO)?
>
> I tried to define a key in both objects but didn't succeed... Is there an
> example somewhere?
>
>
>
>