Re: Cayenne And SpringBoot

2019-08-13 Thread Ken Anderson
; @Configuration @SpringBootApplication public class VorjouApplication { public static void main(String[] args) { SpringApplication.run(VorjouApplication.class, args); } @Bean public ICayenneService cayenneService() { return new CayenneService(); } } > On Aug 13, 2019, at 3:

Re: Cayenne And SpringBoot

2019-08-13 Thread Ken Anderson
Here’s what I did - but it’s a year + old… Please note that it also integrates Hikari for connection pools. With the above done, all you should have to do is: @Autowired ICayenneService cayenneService; Again, I probably can’t answer questions too quickly, but hopefully this

Re: Checking a value on a DataObject and modifying it before commit if required

2019-04-04 Thread Ken Anderson
My guess would be “no”. I suggest you don’t model the relationships until the foreign systems are fixed or removed. In the meanwhile, I would implement methods as the relationships, that would know if there’s a fictitious value or not and return NULL for the relationship. When the other

Re: "Phantom" object being created - how and why? [Solved]

2019-02-12 Thread Ken Anderson
Andrew, If you want to create such shortcuts, best to create a method, rather than doing it through the modeler. Glad you got it worked out! Ken > On Feb 12, 2019, at 4:06 PM, Andrew Willerding > wrote: > > I hope I explain this properly and I think I have the issue identified. I > did

Re: "Phantom" object being created - how and why?

2019-02-12 Thread Ken Anderson
So, I don’t know if Cayenne does this, but WebObjects used to create phantom objects too… The reason it did it was because there was a mandatory to-one relationship in the model, where the primary key of the source of the relationship was also the primary key of the related object. This is

Re: Accessing a sequence number in java

2018-05-23 Thread Ken Anderson
Is it a child of another object where the numbers would reset, or is it unique throughout the DB? If so, why isn’t it the primary key? > On May 23, 2018, at 4:52 PM, Tony Giaccone wrote: > > Imagine I have a field in a persistent object, the field is not the primary > key,

Re: In memory DB for unit testing

2018-05-03 Thread Ken Anderson
>>> >>> @BeforeClass >>> public static void beforeClass() { >>> BQRuntime app = TEST_FACTORY >>> .app("-s", "-c", "classpath:config.yml") >>> .autoLoadModules() >>> .crea

Re: Check dirty before write?

2018-04-27 Thread Ken Anderson
the same object is modified multiple times. It is easy to redefine this behavior by overriding "DataObject.writeProperty(..)" and friends in your own superclass. Andrus > On Apr 27, 2018, at 6:31 PM, Ken Anderson <ken.ander...@amphorainc.com> wrote: > &

Check dirty before write?

2018-04-27 Thread Ken Anderson
It *seems* like Cayenne (4.0) doesn’t check to see if a property being set is different from the prior value before making the object dirty. Is that a correct observation? If so, is there a reason it doesn’t? Thanks, Ken Confidentiality Notice: This e-mail and accompanying documents contain

Re: Staged saves pattern ?

2018-04-01 Thread Ken Anderson
gt; - Create child context > - process line 1 > - save to parent > - process line 2 > - save to parent > - process line 3 > - rollback local changes (should roll back to state after we saved line 2) > - process line 4 > - save to parent > > > > > On Thu, Mar 29

Re: Staged saves pattern ?

2018-03-29 Thread Ken Anderson
a previous line. > > > On Thu, Mar 29, 2018 at 5:50 PM, Ken Anderson > <ken.ander...@amphorainc.com> wrote: >> Mike, >> >> The docs say to not go too deep with nested contexts, so I don't think >> that's a viable solution. I'm also not clear what

Re: Staged saves pattern ?

2018-03-29 Thread Ken Anderson
- child4 (line 4) If you want to "undo" the current line, child4.rollbackChangesLocally(); and start on the next line. Note that I have not done anything with child contexts, but this would be how I'd try to solve it. On Wed, Mar 28, 2018 at 9:29 PM, Ken Anderson

Re: Staged saves pattern ?

2018-03-28 Thread Ken Anderson
you can use a database transaction to >> allow saving multiple times without actually having that data be visible >> outside of the transaction. >> >> >> On Wed, Mar 28, 2018 at 6:56 AM Ken Anderson <ken.ander...@amphorainc.com> >> wrote: >>

Re: Staged saves pattern ?

2018-03-28 Thread Ken Anderson
ing errors could be handled in the save with some custom logic and a retry. Or if this isn't a super long process you can use a database transaction to allow saving multiple times without actually having that data be visible outside of the transaction. On Wed, Mar 28, 2018 at 6:56

Staged saves pattern ?

2018-03-28 Thread Ken Anderson
All, We have a process that reads in a file and, for each line, creates or edits objects in the object graph. We only want to commit to the database once at the end. We have a finite set of lines, so memory is not an issue. We need to save only once because saving will actually fire

Re: New Modeler icons

2018-03-20 Thread Ken Anderson
This is beautiful! One question - are we ever going to get the ability to add userInfo like in EOF? I would really like to annotate entities, attributes, and relationships. Is there another way people are doing it? Thanks, Ken > On Mar 20, 2018, at 3:01 AM, Nikita Timofeev

Mixing expressions and raw SQL in Cayenne 4.0B2

2018-03-19 Thread Ken Anderson
All, We’d like to be able to select records from a table where we use an Expression in a SelectQuery for most attributes, but then we want to limit the query to an IN or EXISTS qualifier as well. We’d rather not bring all the objects back just so we can do the query, so we’d like to add

Re: Connection closed running stored proc on SQL Server

2018-01-10 Thread Ken Anderson
For some reason, even though this is happening immediately when the call occurs, changing the timeout fixes it. Crazy! On 1/10/18, 5:05 PM, "Ken Anderson" <ken.ander...@amphorainc.com> wrote: All, We’re running into an issue where our connection to SQL Serve

Connection closed running stored proc on SQL Server

2018-01-10 Thread Ken Anderson
All, We’re running into an issue where our connection to SQL Server is being lost at the moment we try to execute a stored procedure. We’re unfortunately still using 4.0M3 if that matters… Any ideas? Ken java.sql.SQLException: I/O Error: Read timed out at

Re: Modeler no longer running on Mac

2017-12-27 Thread Ken Anderson
cher inside .app was still using the system JRE. Here is how to fix it though: https://twitter.com/andrus_a/status/911565910003068928 HTH, Andrus > On Dec 27, 2017, at 3:31 PM, Ken Anderson <ken.ander...@amphorainc.com> wrote: > > When I try and run the l

Modeler no longer running on Mac

2017-12-27 Thread Ken Anderson
When I try and run the latest 4.0 modeler, it crashes immediately. When I run from the command line, I get this: Exception in thread "main" java.lang.NoClassDefFoundError: com/apple/eawt/AboutHandler at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)

URI for data object?

2017-12-12 Thread Ken Anderson
Everyone, I’ve been looking around the Cayenne API, but have not been able to find a way to serialize an object ID into a string, and then turn that string back into an object ID or object. What’s the best/right way to do this? For instance, if you want to store a reference to a database

Cayenne on Android?

2017-12-11 Thread Ken Anderson
Has anyone used Cayenne on Android? I’m considering making an android equivalent of an iOS app that uses Core Data. It would be great to have an ORM on the Android side. Thanks for any thoughts! Ken

Poorly modeled to-one relationship help

2017-04-17 Thread Ken Anderson
in advance. Ken Ken Anderson CTO Amphora, Inc. Mobile: +1 914 262 8540 [id:image001.png@01CE8142.D18AEB10] www.amphorainc.com<http://www.amphorainc.com/> Confidentiality Notice: This e-mail and accompanying documents contain confidential information intended for a specific individual and p

Re: Creating a fault for an ObjectId

2017-02-15 Thread Ken Anderson
Yes, use the objectID to pass around, but on the receiving end, you should turn it into a fault and release it into the wild. Then, if some code needs it, the fault fires, otherwise – no DB activity. Ken Anderson CTO Amphora, Inc. Mobile: +1 914 262 8540 www.amphorainc.com <h

Re: Creating a fault for an ObjectId

2017-02-15 Thread Ken Anderson
I could certainly use this too! You would think it would be easy… Ken Anderson CTO Amphora, Inc. Mobile: +1 914 262 8540 www.amphorainc.com <http://www.amphorainc.com/> On 2/15/17, 10:45 AM, "Hugi Thordarson" <h...@karlmenn.is> wrote: It can be useful in

Re: Creating a fault for an ObjectId

2017-02-15 Thread Ken Anderson
I do this: dataObject = (DataObject) Cayenne.objectForPK(getObjectContext(), MyEntity.class, oid); But it will do the fetch if it’s not already in cache. Ken Ken Anderson CTO Amphora, Inc. Mobile: +1 914 262 8540 www.amphorainc.com <http://www.amphorainc.com/> On 2/15/17, 9

Generic dictionary data with entities?

2017-02-10 Thread Ken Anderson
Ken Anderson CTO Amphora, Inc. Mobile: +1 914 262 8540 [id:image001.png@01CE8142.D18AEB10] www.amphorainc.com<http://www.amphorainc.com/> Confidentiality Notice: This e-mail and accompanying documents contain confidential information intended for a specific individual and purpose. T

Re: (just for fun) Presenting Cayenne to new users…

2017-01-19 Thread Ken Anderson
We're already using M3 in production - they should just vet M4 and bite the bullet! > On Jan 19, 2017, at 6:19 PM, Hugi Thordarson wrote: > > Did a presentation on Cayenne today to an Ebean-using crowd—the framework > left them slack-jawed and they’re already getting started

Re: Monitoring long running queries

2016-09-09 Thread Ken Anderson
We would like that too! Ken Anderson CTO Amphora, Inc. Mobile: +1 914 262 8540 www.amphorainc.com <http://www.amphorainc.com/> On 9/9/16, 9:42 AM, "Hugi Thordarson" <h...@karlmenn.is> wrote: Hi all, in EOF we could make the application log a warning if

Re: Multiple relationships from inheritance tree

2016-07-28 Thread Ken Anderson
Andrus, What’s the correct version of the relationship? I’m happy to do it manually as opposed to syncing it. Should we just have a relationship to the base class? Ken Ken Anderson CTO Amphora, Inc. Mobile: +1 914 262 8540 www.amphorainc.com <http://www.amphorainc.com/> On 7

Multiple relationships from inheritance tree

2016-07-13 Thread Ken Anderson
ObjEntity. Is this correct? Can Cayenne not handle a relationship to a super entity? It’s not clear if I should rename them (right now they’re named for the target DBEntity, then 1, 2, 3, etc). Are they there just for internal management? Thanks! Ken Ken Anderson CTO Amphora, Inc. Mobile