You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Tony Giaccone <tg...@gmail.com> on 2013/08/06 01:03:55 UTC

Flattened relationships

I have a User a Role and a UserRole. UserRole represents the Join Table between the two.

The User has a flattened relationship through UserRole to Roles. It's marked as to many, list.

The Role had a flattened relationship to Users it's marked in the modeler as to many, read-only, list.


I want to add a standard role to the user. I fetch the role, create the user. The use:

newUser.addToRoles(userRole);
context.commitChanges();

And an exception gets thrown.

Cannot set the read-only flattened relationship 'users' in ObjEntity 'Role'

What am I missing? Do I need accessors for the UserRole? I thought I could Dispose of that class. I'm confused.

Tony Giaccone


Re: Cayenne modeler (multiple windows)

Posted by Michael Gentry <mg...@masslight.net>.
Hi Tony,

I believe you will also need to send in a CLA:
http://www.apache.org/licenses/#clas (even if adding diffs/patches to
JIRA issues).

We aren't using git-flow.

mrg


On Fri, Aug 9, 2013 at 11:21 AM, Tony Giaccone <tg...@gmail.com> wrote:
>
> I'm checking out the trunk from the Cayenne github source.  And I'll start looking at it from there..
>
> Are you folks using git-flow?
>
> Tony
>
>
> On Aug 8, 2013, at 12:35 AM, Aristedes Maniatis <ar...@maniatis.org> wrote:
>
>> Hi Tony
>>
>> That's brilliant. The process is really quite simple. Firstly, let's take this conversation over to the dev list (and just reply to that list).
>>
>> Next, make sure you are working from the trunk code in svn [1] or use github if you prefer [2]. The end results of work should then ideally be either some patches on github which can be reviewed, or a single patch file against svn. Obviously it is important that you put the appropriate Apache license headers into any files you create, so that your work can be merged.
>>
>> Regards
>> Ari
>>
>>
>> [1] http://svn.apache.org/repos/asf/cayenne/main/trunk/
>> [2] https://github.com/apache/cayenne/tree/trunk
>>
>>
>>
>> On 8/08/13 12:49pm, Tony Giaccone wrote:
>>> If you're looking for an engineer to do this work. I'd be willing to put
>>> some time into it. I'd need some guidance what to modify, but I'd be
>>> willing to commit to do the work. I used to work with Mike Gentry, so he
>>> can vouch for my engineering skills, such as they are.
>>>
>>> Tony
>>>
>>>
>>> On Wed, Aug 7, 2013 at 6:43 AM, Andrus Adamchik <an...@objectstyle.org>wrote:
>>>
>>>> Not extremely hard, but this is certainly not a 2 hour project.
>>>>
>>>>
>>>> On Aug 7, 2013, at 12:25 PM, Tony Giaccone <to...@giaccone.org> wrote:
>>>>
>>>>> How hard would it be to modify the modeler to do that?
>>>>>
>>>>>
>>>>> Tony
>>>>>
>>>>>
>>>>> On Tue, Aug 6, 2013 at 7:44 AM, Andrus Adamchik <andrus@objectstyle.org
>>>>> wrote:
>>>>>
>>>>>> FWIW, I'd also like to be able to open multiple projects, although for a
>>>>>> different reason. I have a number of projects in a single system that
>>>> I'd
>>>>>> like to work with simultaneously.
>>>>>>
>>>>>> Andrus
>>>>>>
>>>>>> On Aug 6, 2013, at 2:39 PM, Tony Giaccone <tg...@gmail.com> wrote:
>>>>>>
>>>>>>> Yeah it's possible, but.. The whole point of the modeler is to shield
>>>>>> people from having to hand edit XML and because the modeler does that so
>>>>>> well it means that average developers aren't familiar with the XML
>>>>>> structure and options.
>>>>>>>
>>>>>>> Being able to open two models at the same time seems like a pretty
>>>>>> reasonable thing to be able to do.
>>>>>>>
>>>>>>> Tony
>>>>>>>
>>>>>>> On Aug 6, 2013, at 1:18 AM, Aristedes Maniatis <ar...@maniatis.org>
>>>> wrote:
>>>>>>>
>>>>>>>> Don't forget that the model is just XML, so you can diff that
>>>> directly.
>>>>>> And applications like Oxygen can diff XML ignoring whitespace and
>>>> changes
>>>>>> in element ordering.
>>>>>>>>
>>>>>>>> Ari
>>>>>>>>
>>>>>>>> On 6/08/13 2:17pm, Tony Giaccone wrote:
>>>>>>>>> One thing that became very clear is that it would be really nice,
>>>>>> really,
>>>>>>>>> really nice to be able to open two (or more) projects in the modeler
>>>>>> at the
>>>>>>>>> same time. It's exceptionally difficult to do comparisons between
>>>>>>>>> attributes and relationships in two different models when you have to
>>>>>> close
>>>>>>>>> one model to open the other. I ended up doing screen captures to
>>>>>> compare
>>>>>>>>> one to the live open project. This worked but was exceptionally
>>>>>> painful.
>>>>>>>>
>>>>>>>> --
>>>>>>>> -------------------------->
>>>>>>>> Aristedes Maniatis
>>>>>>>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>
>>
>> --
>> -------------------------->
>> Aristedes Maniatis
>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>

Re: Cayenne modeler (multiple windows)

Posted by Tony Giaccone <tg...@gmail.com>.
I'm checking out the trunk from the Cayenne github source.  And I'll start looking at it from there..

Are you folks using git-flow? 

Tony


On Aug 8, 2013, at 12:35 AM, Aristedes Maniatis <ar...@maniatis.org> wrote:

> Hi Tony
> 
> That's brilliant. The process is really quite simple. Firstly, let's take this conversation over to the dev list (and just reply to that list).
> 
> Next, make sure you are working from the trunk code in svn [1] or use github if you prefer [2]. The end results of work should then ideally be either some patches on github which can be reviewed, or a single patch file against svn. Obviously it is important that you put the appropriate Apache license headers into any files you create, so that your work can be merged.
> 
> Regards
> Ari
> 
> 
> [1] http://svn.apache.org/repos/asf/cayenne/main/trunk/
> [2] https://github.com/apache/cayenne/tree/trunk
> 
> 
> 
> On 8/08/13 12:49pm, Tony Giaccone wrote:
>> If you're looking for an engineer to do this work. I'd be willing to put
>> some time into it. I'd need some guidance what to modify, but I'd be
>> willing to commit to do the work. I used to work with Mike Gentry, so he
>> can vouch for my engineering skills, such as they are.
>> 
>> Tony
>> 
>> 
>> On Wed, Aug 7, 2013 at 6:43 AM, Andrus Adamchik <an...@objectstyle.org>wrote:
>> 
>>> Not extremely hard, but this is certainly not a 2 hour project.
>>> 
>>> 
>>> On Aug 7, 2013, at 12:25 PM, Tony Giaccone <to...@giaccone.org> wrote:
>>> 
>>>> How hard would it be to modify the modeler to do that?
>>>> 
>>>> 
>>>> Tony
>>>> 
>>>> 
>>>> On Tue, Aug 6, 2013 at 7:44 AM, Andrus Adamchik <andrus@objectstyle.org
>>>> wrote:
>>>> 
>>>>> FWIW, I'd also like to be able to open multiple projects, although for a
>>>>> different reason. I have a number of projects in a single system that
>>> I'd
>>>>> like to work with simultaneously.
>>>>> 
>>>>> Andrus
>>>>> 
>>>>> On Aug 6, 2013, at 2:39 PM, Tony Giaccone <tg...@gmail.com> wrote:
>>>>> 
>>>>>> Yeah it's possible, but.. The whole point of the modeler is to shield
>>>>> people from having to hand edit XML and because the modeler does that so
>>>>> well it means that average developers aren't familiar with the XML
>>>>> structure and options.
>>>>>> 
>>>>>> Being able to open two models at the same time seems like a pretty
>>>>> reasonable thing to be able to do.
>>>>>> 
>>>>>> Tony
>>>>>> 
>>>>>> On Aug 6, 2013, at 1:18 AM, Aristedes Maniatis <ar...@maniatis.org>
>>> wrote:
>>>>>> 
>>>>>>> Don't forget that the model is just XML, so you can diff that
>>> directly.
>>>>> And applications like Oxygen can diff XML ignoring whitespace and
>>> changes
>>>>> in element ordering.
>>>>>>> 
>>>>>>> Ari
>>>>>>> 
>>>>>>> On 6/08/13 2:17pm, Tony Giaccone wrote:
>>>>>>>> One thing that became very clear is that it would be really nice,
>>>>> really,
>>>>>>>> really nice to be able to open two (or more) projects in the modeler
>>>>> at the
>>>>>>>> same time. It's exceptionally difficult to do comparisons between
>>>>>>>> attributes and relationships in two different models when you have to
>>>>> close
>>>>>>>> one model to open the other. I ended up doing screen captures to
>>>>> compare
>>>>>>>> one to the live open project. This worked but was exceptionally
>>>>> painful.
>>>>>>> 
>>>>>>> --
>>>>>>> -------------------------->
>>>>>>> Aristedes Maniatis
>>>>>>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>>>>>> 
>>>>> 
>>>>> 
>>> 
>>> 
>> 
> 
> -- 
> -------------------------->
> Aristedes Maniatis
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A


Re: Cayenne modeler (multiple windows)

Posted by Aristedes Maniatis <ar...@maniatis.org>.
Hi Tony

That's brilliant. The process is really quite simple. Firstly, let's take this conversation over to the dev list (and just reply to that list).

Next, make sure you are working from the trunk code in svn [1] or use github if you prefer [2]. The end results of work should then ideally be either some patches on github which can be reviewed, or a single patch file against svn. Obviously it is important that you put the appropriate Apache license headers into any files you create, so that your work can be merged.

Regards
Ari


[1] http://svn.apache.org/repos/asf/cayenne/main/trunk/
[2] https://github.com/apache/cayenne/tree/trunk



On 8/08/13 12:49pm, Tony Giaccone wrote:
> If you're looking for an engineer to do this work. I'd be willing to put
> some time into it. I'd need some guidance what to modify, but I'd be
> willing to commit to do the work. I used to work with Mike Gentry, so he
> can vouch for my engineering skills, such as they are.
> 
> Tony
> 
> 
> On Wed, Aug 7, 2013 at 6:43 AM, Andrus Adamchik <an...@objectstyle.org>wrote:
> 
>> Not extremely hard, but this is certainly not a 2 hour project.
>>
>>
>> On Aug 7, 2013, at 12:25 PM, Tony Giaccone <to...@giaccone.org> wrote:
>>
>>> How hard would it be to modify the modeler to do that?
>>>
>>>
>>> Tony
>>>
>>>
>>> On Tue, Aug 6, 2013 at 7:44 AM, Andrus Adamchik <andrus@objectstyle.org
>>> wrote:
>>>
>>>> FWIW, I'd also like to be able to open multiple projects, although for a
>>>> different reason. I have a number of projects in a single system that
>> I'd
>>>> like to work with simultaneously.
>>>>
>>>> Andrus
>>>>
>>>> On Aug 6, 2013, at 2:39 PM, Tony Giaccone <tg...@gmail.com> wrote:
>>>>
>>>>> Yeah it's possible, but.. The whole point of the modeler is to shield
>>>> people from having to hand edit XML and because the modeler does that so
>>>> well it means that average developers aren't familiar with the XML
>>>> structure and options.
>>>>>
>>>>> Being able to open two models at the same time seems like a pretty
>>>> reasonable thing to be able to do.
>>>>>
>>>>> Tony
>>>>>
>>>>> On Aug 6, 2013, at 1:18 AM, Aristedes Maniatis <ar...@maniatis.org>
>> wrote:
>>>>>
>>>>>> Don't forget that the model is just XML, so you can diff that
>> directly.
>>>> And applications like Oxygen can diff XML ignoring whitespace and
>> changes
>>>> in element ordering.
>>>>>>
>>>>>> Ari
>>>>>>
>>>>>> On 6/08/13 2:17pm, Tony Giaccone wrote:
>>>>>>> One thing that became very clear is that it would be really nice,
>>>> really,
>>>>>>> really nice to be able to open two (or more) projects in the modeler
>>>> at the
>>>>>>> same time. It's exceptionally difficult to do comparisons between
>>>>>>> attributes and relationships in two different models when you have to
>>>> close
>>>>>>> one model to open the other. I ended up doing screen captures to
>>>> compare
>>>>>>> one to the live open project. This worked but was exceptionally
>>>> painful.
>>>>>>
>>>>>> --
>>>>>> -------------------------->
>>>>>> Aristedes Maniatis
>>>>>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>>>>>
>>>>
>>>>
>>
>>
> 

-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Re: Cayenne modeler (multiple windows)

Posted by Aristedes Maniatis <ar...@maniatis.org>.
Hi Tony

That's brilliant. The process is really quite simple. Firstly, let's take this conversation over to the dev list (and just reply to that list).

Next, make sure you are working from the trunk code in svn [1] or use github if you prefer [2]. The end results of work should then ideally be either some patches on github which can be reviewed, or a single patch file against svn. Obviously it is important that you put the appropriate Apache license headers into any files you create, so that your work can be merged.

Regards
Ari


[1] http://svn.apache.org/repos/asf/cayenne/main/trunk/
[2] https://github.com/apache/cayenne/tree/trunk



On 8/08/13 12:49pm, Tony Giaccone wrote:
> If you're looking for an engineer to do this work. I'd be willing to put
> some time into it. I'd need some guidance what to modify, but I'd be
> willing to commit to do the work. I used to work with Mike Gentry, so he
> can vouch for my engineering skills, such as they are.
> 
> Tony
> 
> 
> On Wed, Aug 7, 2013 at 6:43 AM, Andrus Adamchik <an...@objectstyle.org>wrote:
> 
>> Not extremely hard, but this is certainly not a 2 hour project.
>>
>>
>> On Aug 7, 2013, at 12:25 PM, Tony Giaccone <to...@giaccone.org> wrote:
>>
>>> How hard would it be to modify the modeler to do that?
>>>
>>>
>>> Tony
>>>
>>>
>>> On Tue, Aug 6, 2013 at 7:44 AM, Andrus Adamchik <andrus@objectstyle.org
>>> wrote:
>>>
>>>> FWIW, I'd also like to be able to open multiple projects, although for a
>>>> different reason. I have a number of projects in a single system that
>> I'd
>>>> like to work with simultaneously.
>>>>
>>>> Andrus
>>>>
>>>> On Aug 6, 2013, at 2:39 PM, Tony Giaccone <tg...@gmail.com> wrote:
>>>>
>>>>> Yeah it's possible, but.. The whole point of the modeler is to shield
>>>> people from having to hand edit XML and because the modeler does that so
>>>> well it means that average developers aren't familiar with the XML
>>>> structure and options.
>>>>>
>>>>> Being able to open two models at the same time seems like a pretty
>>>> reasonable thing to be able to do.
>>>>>
>>>>> Tony
>>>>>
>>>>> On Aug 6, 2013, at 1:18 AM, Aristedes Maniatis <ar...@maniatis.org>
>> wrote:
>>>>>
>>>>>> Don't forget that the model is just XML, so you can diff that
>> directly.
>>>> And applications like Oxygen can diff XML ignoring whitespace and
>> changes
>>>> in element ordering.
>>>>>>
>>>>>> Ari
>>>>>>
>>>>>> On 6/08/13 2:17pm, Tony Giaccone wrote:
>>>>>>> One thing that became very clear is that it would be really nice,
>>>> really,
>>>>>>> really nice to be able to open two (or more) projects in the modeler
>>>> at the
>>>>>>> same time. It's exceptionally difficult to do comparisons between
>>>>>>> attributes and relationships in two different models when you have to
>>>> close
>>>>>>> one model to open the other. I ended up doing screen captures to
>>>> compare
>>>>>>> one to the live open project. This worked but was exceptionally
>>>> painful.
>>>>>>
>>>>>> --
>>>>>> -------------------------->
>>>>>> Aristedes Maniatis
>>>>>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>>>>>
>>>>
>>>>
>>
>>
> 

-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Re: Flattened relationships

Posted by Tony Giaccone <tg...@gmail.com>.
If you're looking for an engineer to do this work. I'd be willing to put
some time into it. I'd need some guidance what to modify, but I'd be
willing to commit to do the work. I used to work with Mike Gentry, so he
can vouch for my engineering skills, such as they are.

Tony


On Wed, Aug 7, 2013 at 6:43 AM, Andrus Adamchik <an...@objectstyle.org>wrote:

> Not extremely hard, but this is certainly not a 2 hour project.
>
>
> On Aug 7, 2013, at 12:25 PM, Tony Giaccone <to...@giaccone.org> wrote:
>
> > How hard would it be to modify the modeler to do that?
> >
> >
> > Tony
> >
> >
> > On Tue, Aug 6, 2013 at 7:44 AM, Andrus Adamchik <andrus@objectstyle.org
> >wrote:
> >
> >> FWIW, I'd also like to be able to open multiple projects, although for a
> >> different reason. I have a number of projects in a single system that
> I'd
> >> like to work with simultaneously.
> >>
> >> Andrus
> >>
> >> On Aug 6, 2013, at 2:39 PM, Tony Giaccone <tg...@gmail.com> wrote:
> >>
> >>> Yeah it's possible, but.. The whole point of the modeler is to shield
> >> people from having to hand edit XML and because the modeler does that so
> >> well it means that average developers aren't familiar with the XML
> >> structure and options.
> >>>
> >>> Being able to open two models at the same time seems like a pretty
> >> reasonable thing to be able to do.
> >>>
> >>> Tony
> >>>
> >>> On Aug 6, 2013, at 1:18 AM, Aristedes Maniatis <ar...@maniatis.org>
> wrote:
> >>>
> >>>> Don't forget that the model is just XML, so you can diff that
> directly.
> >> And applications like Oxygen can diff XML ignoring whitespace and
> changes
> >> in element ordering.
> >>>>
> >>>> Ari
> >>>>
> >>>> On 6/08/13 2:17pm, Tony Giaccone wrote:
> >>>>> One thing that became very clear is that it would be really nice,
> >> really,
> >>>>> really nice to be able to open two (or more) projects in the modeler
> >> at the
> >>>>> same time. It's exceptionally difficult to do comparisons between
> >>>>> attributes and relationships in two different models when you have to
> >> close
> >>>>> one model to open the other. I ended up doing screen captures to
> >> compare
> >>>>> one to the live open project. This worked but was exceptionally
> >> painful.
> >>>>
> >>>> --
> >>>> -------------------------->
> >>>> Aristedes Maniatis
> >>>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
> >>>
> >>
> >>
>
>

Re: Flattened relationships

Posted by Andrus Adamchik <an...@objectstyle.org>.
Not extremely hard, but this is certainly not a 2 hour project. 


On Aug 7, 2013, at 12:25 PM, Tony Giaccone <to...@giaccone.org> wrote:

> How hard would it be to modify the modeler to do that?
> 
> 
> Tony
> 
> 
> On Tue, Aug 6, 2013 at 7:44 AM, Andrus Adamchik <an...@objectstyle.org>wrote:
> 
>> FWIW, I'd also like to be able to open multiple projects, although for a
>> different reason. I have a number of projects in a single system that I'd
>> like to work with simultaneously.
>> 
>> Andrus
>> 
>> On Aug 6, 2013, at 2:39 PM, Tony Giaccone <tg...@gmail.com> wrote:
>> 
>>> Yeah it's possible, but.. The whole point of the modeler is to shield
>> people from having to hand edit XML and because the modeler does that so
>> well it means that average developers aren't familiar with the XML
>> structure and options.
>>> 
>>> Being able to open two models at the same time seems like a pretty
>> reasonable thing to be able to do.
>>> 
>>> Tony
>>> 
>>> On Aug 6, 2013, at 1:18 AM, Aristedes Maniatis <ar...@maniatis.org> wrote:
>>> 
>>>> Don't forget that the model is just XML, so you can diff that directly.
>> And applications like Oxygen can diff XML ignoring whitespace and changes
>> in element ordering.
>>>> 
>>>> Ari
>>>> 
>>>> On 6/08/13 2:17pm, Tony Giaccone wrote:
>>>>> One thing that became very clear is that it would be really nice,
>> really,
>>>>> really nice to be able to open two (or more) projects in the modeler
>> at the
>>>>> same time. It's exceptionally difficult to do comparisons between
>>>>> attributes and relationships in two different models when you have to
>> close
>>>>> one model to open the other. I ended up doing screen captures to
>> compare
>>>>> one to the live open project. This worked but was exceptionally
>> painful.
>>>> 
>>>> --
>>>> -------------------------->
>>>> Aristedes Maniatis
>>>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>>> 
>> 
>> 


Re: Flattened relationships

Posted by Tony Giaccone <to...@giaccone.org>.
How hard would it be to modify the modeler to do that?


Tony


On Tue, Aug 6, 2013 at 7:44 AM, Andrus Adamchik <an...@objectstyle.org>wrote:

> FWIW, I'd also like to be able to open multiple projects, although for a
> different reason. I have a number of projects in a single system that I'd
> like to work with simultaneously.
>
> Andrus
>
> On Aug 6, 2013, at 2:39 PM, Tony Giaccone <tg...@gmail.com> wrote:
>
> > Yeah it's possible, but.. The whole point of the modeler is to shield
> people from having to hand edit XML and because the modeler does that so
> well it means that average developers aren't familiar with the XML
> structure and options.
> >
> > Being able to open two models at the same time seems like a pretty
> reasonable thing to be able to do.
> >
> > Tony
> >
> > On Aug 6, 2013, at 1:18 AM, Aristedes Maniatis <ar...@maniatis.org> wrote:
> >
> >> Don't forget that the model is just XML, so you can diff that directly.
> And applications like Oxygen can diff XML ignoring whitespace and changes
> in element ordering.
> >>
> >> Ari
> >>
> >> On 6/08/13 2:17pm, Tony Giaccone wrote:
> >>> One thing that became very clear is that it would be really nice,
> really,
> >>> really nice to be able to open two (or more) projects in the modeler
> at the
> >>> same time. It's exceptionally difficult to do comparisons between
> >>> attributes and relationships in two different models when you have to
> close
> >>> one model to open the other. I ended up doing screen captures to
> compare
> >>> one to the live open project. This worked but was exceptionally
> painful.
> >>
> >> --
> >> -------------------------->
> >> Aristedes Maniatis
> >> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
> >
>
>

Re: Flattened relationships

Posted by Andrus Adamchik <an...@objectstyle.org>.
FWIW, I'd also like to be able to open multiple projects, although for a different reason. I have a number of projects in a single system that I'd like to work with simultaneously. 

Andrus

On Aug 6, 2013, at 2:39 PM, Tony Giaccone <tg...@gmail.com> wrote:

> Yeah it's possible, but.. The whole point of the modeler is to shield people from having to hand edit XML and because the modeler does that so well it means that average developers aren't familiar with the XML structure and options.
> 
> Being able to open two models at the same time seems like a pretty reasonable thing to be able to do.
> 
> Tony
> 
> On Aug 6, 2013, at 1:18 AM, Aristedes Maniatis <ar...@maniatis.org> wrote:
> 
>> Don't forget that the model is just XML, so you can diff that directly. And applications like Oxygen can diff XML ignoring whitespace and changes in element ordering.
>> 
>> Ari
>> 
>> On 6/08/13 2:17pm, Tony Giaccone wrote:
>>> One thing that became very clear is that it would be really nice, really,
>>> really nice to be able to open two (or more) projects in the modeler at the
>>> same time. It's exceptionally difficult to do comparisons between
>>> attributes and relationships in two different models when you have to close
>>> one model to open the other. I ended up doing screen captures to compare
>>> one to the live open project. This worked but was exceptionally painful.
>> 
>> -- 
>> -------------------------->
>> Aristedes Maniatis
>> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
> 


Re: Flattened relationships

Posted by Tony Giaccone <tg...@gmail.com>.
Yeah it's possible, but.. The whole point of the modeler is to shield people from having to hand edit XML and because the modeler does that so well it means that average developers aren't familiar with the XML structure and options.

Being able to open two models at the same time seems like a pretty reasonable thing to be able to do.

Tony

On Aug 6, 2013, at 1:18 AM, Aristedes Maniatis <ar...@maniatis.org> wrote:

> Don't forget that the model is just XML, so you can diff that directly. And applications like Oxygen can diff XML ignoring whitespace and changes in element ordering.
> 
> Ari
> 
> On 6/08/13 2:17pm, Tony Giaccone wrote:
>> One thing that became very clear is that it would be really nice, really,
>> really nice to be able to open two (or more) projects in the modeler at the
>> same time. It's exceptionally difficult to do comparisons between
>> attributes and relationships in two different models when you have to close
>> one model to open the other. I ended up doing screen captures to compare
>> one to the live open project. This worked but was exceptionally painful.
> 
> -- 
> -------------------------->
> Aristedes Maniatis
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Re: Flattened relationships

Posted by Aristedes Maniatis <ar...@maniatis.org>.
Don't forget that the model is just XML, so you can diff that directly. And applications like Oxygen can diff XML ignoring whitespace and changes in element ordering.

Ari

On 6/08/13 2:17pm, Tony Giaccone wrote:
> One thing that became very clear is that it would be really nice, really,
> really nice to be able to open two (or more) projects in the modeler at the
> same time. It's exceptionally difficult to do comparisons between
> attributes and relationships in two different models when you have to close
> one model to open the other. I ended up doing screen captures to compare
> one to the live open project. This worked but was exceptionally painful.

-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Re: Flattened relationships

Posted by Tony Giaccone <tg...@gmail.com>.
So it was, as I expected, it was my mistake. The "To many" check box was
checked on one relationship of the USER_ROLE's two relationships. So
instead of having a to one relationship to User and a to one relationship
to Role. The join table was a to many to Role, which Cayenne then managed
by marking that relationship as "read-only". This caused the insert on the
read-only side of the relationship to fail.

One thing that became very clear is that it would be really nice, really,
really nice to be able to open two (or more) projects in the modeler at the
same time. It's exceptionally difficult to do comparisons between
attributes and relationships in two different models when you have to close
one model to open the other. I ended up doing screen captures to compare
one to the live open project. This worked but was exceptionally painful.

Second is that in your model, you don't have the join table set up to have
a compound primary key. I changed mine to also not have that primary key
flag set, but when I save the modeler chides me about the table not having
a primary key. I'm using Derby, you're using H2, but I'm surprised the
modeler doesn't complain when your model gets saved. Odd..

Tony


On Mon, Aug 5, 2013 at 7:31 PM, Michael Gentry <mg...@masslight.net>wrote:

> Hi Tony,
>
> Does your UserRole have more than 2 FKs in it?  Did you map UserRole
> to a Java class in addition to the DB mapping or do you just have the
> DB mapping?  You should be able to do what you want.  I happen to have
> an old working example here that does exactly what you are describing:
>
>
> https://github.com/mrg/cbe/blob/master/InsertingObjects/ManyToMany/src/main/java/cbe/inserting/ManyToMany.java
>
> The complete project has a model you can reference, too.
>
> mrg
>
> On Mon, Aug 5, 2013 at 7:03 PM, Tony Giaccone <tg...@gmail.com> wrote:
> >
> > I have a User a Role and a UserRole. UserRole represents the Join Table
> between the two.
> >
> > The User has a flattened relationship through UserRole to Roles. It's
> marked as to many, list.
> >
> > The Role had a flattened relationship to Users it's marked in the
> modeler as to many, read-only, list.
> >
> >
> > I want to add a standard role to the user. I fetch the role, create the
> user. The use:
> >
> > newUser.addToRoles(userRole);
> > context.commitChanges();
> >
> > And an exception gets thrown.
> >
> > Cannot set the read-only flattened relationship 'users' in ObjEntity
> 'Role'
> >
> > What am I missing? Do I need accessors for the UserRole? I thought I
> could Dispose of that class. I'm confused.
> >
> > Tony Giaccone
> >
>

Re: Flattened relationships

Posted by Michael Gentry <mg...@masslight.net>.
Hi Tony,

Does your UserRole have more than 2 FKs in it?  Did you map UserRole
to a Java class in addition to the DB mapping or do you just have the
DB mapping?  You should be able to do what you want.  I happen to have
an old working example here that does exactly what you are describing:

https://github.com/mrg/cbe/blob/master/InsertingObjects/ManyToMany/src/main/java/cbe/inserting/ManyToMany.java

The complete project has a model you can reference, too.

mrg

On Mon, Aug 5, 2013 at 7:03 PM, Tony Giaccone <tg...@gmail.com> wrote:
>
> I have a User a Role and a UserRole. UserRole represents the Join Table between the two.
>
> The User has a flattened relationship through UserRole to Roles. It's marked as to many, list.
>
> The Role had a flattened relationship to Users it's marked in the modeler as to many, read-only, list.
>
>
> I want to add a standard role to the user. I fetch the role, create the user. The use:
>
> newUser.addToRoles(userRole);
> context.commitChanges();
>
> And an exception gets thrown.
>
> Cannot set the read-only flattened relationship 'users' in ObjEntity 'Role'
>
> What am I missing? Do I need accessors for the UserRole? I thought I could Dispose of that class. I'm confused.
>
> Tony Giaccone
>