Re: Passing Blobs to stored procedure

2011-09-06 Thread Andrus Adamchik
If you look at the OracleAdapter code in Cayenne and related classes, you'll see how bad we have to bend things to ensure users can seamlessly work with Oracle CLOB/BLOB. So that's the answer to the last question :-) Insert/update/delete/select should work with LOB columns. I guess we just over

Re: Passing Blobs to stored procedure

2011-09-06 Thread Joseph Senecal
Hi Andrus, Currently the code is passing in a byte[], Cayenne is converting that into a MemoryBlob. I have no problem with passing in a BLOB instead, but when I looked up how to create a BLOB I got stuck. It requires a java.sql.Connection as a parameter, and I haven't been able to find a way to

Re: Getting null instead of the actual value

2011-09-06 Thread Joe Baldwin
Christian BTW, the "totally easy" was not a smart-alec remark. :) I think it is essential to note that you have to do 3 steps: get your ObjectContext, create the new entity using the "newObject" method, and then eventually "commitChanges". My experience has been that if you do not do these th

Re: Getting null instead of the actual value

2011-09-06 Thread Christian Grobmeier
On Tue, Sep 6, 2011 at 6:55 PM, Mike Kienenberger wrote: > It's probably also worth noting that, as MIchael's example shows, you > do not need to set both sides of the relationship. OK. I have done this while investigating my error - I thought this might be the case (like I had once in Hibernate

Re: Getting null instead of the actual value

2011-09-06 Thread Mike Kienenberger
It's probably also worth noting that, as MIchael's example shows, you do not need to set both sides of the relationship. On Tue, Sep 6, 2011 at 12:46 PM, Christian Grobmeier wrote: > Hi Michael, > >> I suspect it is because you are creating the UserRole outside the >> DataContext.  Try something

Re: Getting null instead of the actual value

2011-09-06 Thread Christian Grobmeier
> I assumed Christian was calling commitChanges() and was just showing a > smaller snippet of code.  Perhaps my assumption there was incorrect, > though. No it was correct - i tried to make it readable and as easy to understand as possible > > Thanks, > > mrg > > > On Tue, Sep 6, 2011 at 12:20 PM

Re: Getting null instead of the actual value

2011-09-06 Thread Christian Grobmeier
Hi Michael, > I suspect it is because you are creating the UserRole outside the > DataContext.  Try something like: > > UserRoles userRoles = user.getObjectContext.newObject(UserRoles.class); > userRoles.setUser(user); > userRoles.setRole(role); actually this might be the case - I will test this.

Re: Getting null instead of the actual value

2011-09-06 Thread Christian Grobmeier
Joe, > It is a tad difficult to follow all of your pseudo-code (as with all > pseudo-code), but it appears that you are adding to "UserRoles" object via > Cayenne and that you have left out the step to "commitChanges" on your > ObjectContext. > > Here is the basic pseudo code for Cayenne usage

Re: Getting null instead of the actual value

2011-09-06 Thread Michael Gentry
Hi Joe, I assumed Christian was calling commitChanges() and was just showing a smaller snippet of code. Perhaps my assumption there was incorrect, though. Thanks, mrg On Tue, Sep 6, 2011 at 12:20 PM, Joe Baldwin wrote: > Michael, > > I thought that you need to commit changes on the ObjectCon

Re: Getting null instead of the actual value

2011-09-06 Thread Joe Baldwin
Michael, I thought that you need to commit changes on the ObjectContext at some point or else the new object will not be persisted. Is this step not needed? Joe On Sep 6, 2011, at 11:42 AM, Michael Gentry wrote: > Hi Christian, > > I suspect it is because you are creating the UserRole out

Re: Getting null instead of the actual value

2011-09-06 Thread Michael Gentry
Hi Christian, I suspect it is because you are creating the UserRole outside the DataContext. Try something like: UserRoles userRoles = user.getObjectContext.newObject(UserRoles.class); userRoles.setUser(user); userRoles.setRole(role); mrg On Tue, Sep 6, 2011 at 11:14 AM, Christian Grobmeier

Re: Getting null instead of the actual value

2011-09-06 Thread Joe Baldwin
Christian, It is a tad difficult to follow all of your pseudo-code (as with all pseudo-code), but it appears that you are adding to "UserRoles" object via Cayenne and that you have left out the step to "commitChanges" on your ObjectContext. Here is the basic pseudo code for Cayenne usage model

Getting null instead of the actual value

2011-09-06 Thread Christian Grobmeier
Folks, I need your help. An error in my app bugs me and I am looking desperately were it could happen. The use case is: - create a user - create a user_role object - select one of the existing roles - connect all together and commit I see that all values are correct in the database (mysql consol

Re: Size of Object Cache in Modeller has no effect

2011-09-06 Thread Marc O'Morain
Aha, it's a UI issue - it seems you need to click around into other UI elements to make sure that the Modeller thinks that the value is dirty, before saving. On Tue, Sep 6, 2011 at 11:12 AM, Marc O'Morain wrote: > Hi there, > > When I change the value of "Size of Object Cache" in my project in th

Size of Object Cache in Modeller has no effect

2011-09-06 Thread Marc O'Morain
Hi there, When I change the value of "Size of Object Cache" in my project in the Modeller, there is no effect in the generated cayenne.xml. (Or any file under git (cayenne.xml, and the map and node xml files). I assume it's meant to change something? Is this is known issue? Thanks, Marc