Re: UUIDs

2024-08-27 Thread Jurgen Doll
confusing. It should be expanded into a list of specific strategies (PK table, PK procedure, PK sequence, UUID). Each one can have its own implementation per DbAdapter. Andrus On Aug 26, 2024, at 7:24 AM, Jurgen Doll wrote: Hi Michael So Cayenne actually currently does support generati

Re: UUIDs

2024-08-26 Thread Jurgen Doll
Hi Michael So Cayenne actually currently does support generating UUID PK's, if in the Cayenne Modeler you: 1. set your column type to BINARY 2. set it to a length of 16 3. check the PK flag, and 4. set the table's "PK Generation Strategy" to Cayenne This will result in a UUID being generated

Deleting ObjEntity with flattened attribute

2024-05-05 Thread Jurgen Doll
Hi All I've recently upgraded from Cayenne 3.1 to 4.2 and noticed that when deleting an ObjEntity with flattened attributes Cayenne now deletes the related DB attribute's row as well. So if we have for example an ObjEntity "FlatPainting" with flattened attribute "galleryName". If we then

Re: Complicated SQL queries

2024-02-07 Thread Jurgen Doll
Try the following version and see if it works for you: ObjectSelect.query( ObjectEntityA.class ) .columns( ObjEntityA.PROP_FOR_OBJECT_B .dot( ObjEntityB.PROP_FOR_OBJECT_C ) .dot( ObjEntityC.PROP_FOR_OBJECT_D ) .count() ) .where( ObjEntityA.

Re: Complicated SQL queries

2024-02-06 Thread Jurgen Doll
ables manually using the.passed in Object[]; On Thu, Feb 1, 2024 at 2:43 AM Jurgen Doll wrote: If we were getting DataRow(s) returned then yes, but with a column[] no, and as far as I know there's no way to restructure the ObjectSelect query to return suitable DataRow(s). Alternatively there i

Re: Complicated SQL queries

2024-02-01 Thread Jurgen Doll
Jan 31, 2024 at 12:21 AM Jurgen Doll wrote: Hi Christian Since the selected columns are all that’s required for ObjEntityE and there’s a simple relationship between ObjEntityE and ObjEntityA we should be able to just get ObjEntityE directly: List results = ObjectSelect.query( O

RE: Complicated SQL queries

2024-01-30 Thread Jurgen Doll
2024 at 12:19 AM Jurgen Doll wrote: > Ahh, my bad again - I missed the whole point of using ObjectSelect > somehow, probably because it's difficult to explain without having your > model. Anyways here's a shot at it, conceptually the same as what you did > i

Re: Complicated SQL queries

2024-01-21 Thread Jurgen Doll
lthough I'm not sure about how I feel about having to make a new entity every time a query like this is used but hopefully it won't be too often. Thank you for your help. On Wed, Jan 17, 2024 at 11:08 AM Jurgen Doll wrote: Ahh, sorry my bad I didn't see the t0 for tableE. T

Re: Complicated SQL queries

2024-01-17 Thread Jurgen Doll
Ahh, sorry my bad I didn't see the t0 for tableE. There may be other ways to do it but I think adding t3.varB as an attribute to the object entity might be the simplest. Regards Jurgen

Re: Complicated SQL queries

2024-01-16 Thread Jurgen Doll
Hi Christian Try the following steps: 1. Open Cayenne Modeler 2. Create an ObjEntity 3. Give it a name and select tableA 4. Click on the Properties tab 5. Click on "Create Attribute" icon/button 6. Click on "Edit Attribute" icon/button 7. Enter the Attributes Name and select its Ja

Re: Dealing with a commit exception....

2021-06-24 Thread Jurgen Doll
I'm not sure about this, but I don't think Cayenne does SQL batch insert statements - it does each insert (even in a batch) as single SQL insert statements. If this is the case then there's no real advantage, I think, to doing batch commits with Cayenne in this particular case (or am I mist

Re: Using inheritance.

2019-10-29 Thread Jurgen Doll
Hi Tony What about using inheritance but leave out the ACCOUNT field in the parent and put it in the respective child classes. So then the one child class will have registrationNumber and the other will have accountNumber, but both of these will point to the same ACCOUNT field in the DB. Jur

Re: Best Practice for blobs

2019-10-03 Thread Jurgen Doll
Hi Lon Not sure if this is best practice but I created two Cayenne object entities where the first excludes the blob and the second only has the blob. Then I either: 1. Added a relationship attribute in the first pointing to the second, based on a 1:1 relationship in the DbEntity. 2. Or I

Re: MappedSelect/SQLTemplate #chain and #chunk directives

2019-10-03 Thread Jurgen Doll
Hi John Just add the parameters like you normally would when using #bind on its own, like so: queryParameters.put( "thing1", new Integer(9) ); queryParameters.put( "thing2", new Timestamp( ... ) ); Jurgen -Original Message- From: John Huss Sent: Thursday, October 3, 2019 12:12 AM