Re: How to use a custom aggregate function?

2024-01-05 Thread Mark Stobbe
LTreeProcessor > (something that was mentioned a few months ago in a different context) > > I am really curious if #1 works, and if it doesn't, be happy to provide > pointers on #2. > > Thanks, > Andrus > > > > On Jan 4, 2024, at 10:12 AM, Mark Stobbe wrote: &

How to use a custom aggregate function?

2024-01-04 Thread Mark Stobbe
Hi all, Does anyone know how to use "array_agg" as a function? I am using Cayenne 4.2.M3, but it's ok if I need to upgrade to a later version. I was trying with someProperty.function("array_agg", List.class) but it will not automatically group by all the other fields since it doesn't recognise

Join ordering

2023-05-20 Thread Mark Stobbe
Hi all, We are running into an issue with the specific join ordering that Cayenne ( 4.2.M3) does. We are using a ColumnSelect to select multiple columns across different tables with a simple where statement. SELECT * FROM my_table t0 LEFT JOIN my_detail1 t1 ON t0.fk_one = t1.id LEFT JOIN

Re: Bug in DataRowsUtils

2020-11-11 Thread Mark Stobbe
dSelects use lowercase names. > > On Wed, Nov 11, 2020 at 3:38 AM Mark Stobbe > wrote: > > > Hi all, > > > > > > > > I was using MappedSelect to query for objects and I was surprised to see > I > > >

Bug in DataRowsUtils

2020-11-11 Thread Mark Stobbe
Hi all, I was using MappedSelect to query for objects and I was surprised to see I was returned a HOLLOW object. After some investigation I found that in DataRowUtils.refreshObjectWithSnapshot there is a check if we fetched the whole object using a map. However, the check

Re: Query timeout in QueryMetadata

2020-11-10 Thread Mark Stobbe
* { > > ... // do stuff > > > tx.commit(); > > } *catch* (Exception e) { > > tx.rollback(); > > *throw* e; > > } > > >> On Tue, Nov 10, 2020 at 7:50 AM Mark Stobbe wrote: >> >> Hi all, >> >> Can we have an option to

Query timeout in QueryMetadata

2020-11-10 Thread Mark Stobbe
Hi all, Can we have an option to set query timeout on the metadata of the query, similar to the statementFetchSize? The workaround seems to involve a lot of subclasses via the adapter; or via the connection but then I need to have the same timeout for all statements or parse SQL to identify

Timeout long running selects

2019-03-23 Thread Mark Stobbe
Hi all, Does anyone have a solution for killing long running SelectQuerys in cayenne? Best regards, Mark

Automatically create index for foreign keys

2017-03-09 Thread Mark Stobbe
Hi all, Do you know if its possible to automatically generate SQL statements for creating indices on foreign key relations? Best regards, Mark

Re: Disjoint by id

2016-11-15 Thread Mark Stobbe
] https://issues.apache.org/jira/browse/CAY-2141 > > > On Nov 14, 2016, at 11:25 PM, Mark Stobbe <markstobb...@gmail.com> > wrote: > > > > Hi Andrus, > > > > Version 3.2M1. Relationship would be a normal to-one yes. I am executing > a > > que

Disjoint by id

2016-11-14 Thread Mark Stobbe
) OR ( t0.id = 219 ) OR ( t0.id = 219 ) OR ( t0.id = 219 ) OR ( t0.id = 219 ) OR ( t0.id = 219 ) OR ( t0.id = 219 ) OR ( t0.id = 219 ) OR ( t0.id = 219 ) OR ( t0.id = 219 ); Best regards, Mark Stobbe

Another EJBQL question

2014-11-07 Thread Mark Stobbe
Thanks everyone for your help with the multi-user stuff!! I managed to implement a hybrid system where individual totals are calculated in the getXXX method and whenever multiple totals are requested at once (e.g. in a table) then it loads them with an EJBQL query. Now I just have to figure out

Re: Updating totals in a multi-user environment

2014-11-02 Thread Mark Stobbe
*orderNumber* as a *referenceNumber* and *referenceType = ORDER* in the ISSUE table. I don't think this is possible at the moment with EJBQL, right? Mark On Sat, Nov 1, 2014 at 3:44 PM, Mark Stobbe markstobb...@gmail.com wrote: Thank you Andrus! I managed to get most of it into the existing

Re: Updating totals in a multi-user environment

2014-11-01 Thread Mark Stobbe
then SQLTemplate for instance. (And its integration into SelectQuery is on the agenda). Andrus On Oct 31, 2014, at 1:38 AM, Mark Stobbe markstobb...@gmail.com wrote: @Andrus, I see. Good to know how to do this in Cayenne. @Michael, You are right. It makes more sense to let the database do

Updating totals in a multi-user environment

2014-10-30 Thread Mark Stobbe
Hi all, I was wondering what is the best way to update totals in a multi-user environment. For example, let's say we have an Order which can have one or more Packages associated and we want to maintain a total package count on the Order entity. How would you update this value when the user has

Re: Updating totals in a multi-user environment

2014-10-30 Thread Mark Stobbe
listeners, datachannel filters and such? Mark On Thu, Oct 30, 2014 at 4:15 PM, Michael Gentry mgen...@masslight.net wrote: Hi Mark, Is there a performance reason why you don't just do a count on the packages that match the order? mrg On Thu, Oct 30, 2014 at 11:00 AM, Mark Stobbe markstobb

Re: Updating totals in a multi-user environment

2014-10-30 Thread Mark Stobbe
Oh, I also have the same problem with total cost with different currencies... On Thu, Oct 30, 2014 at 5:09 PM, Mark Stobbe markstobb...@gmail.com wrote: Hi Michael, I would like to display the count in a table for a whole bunch of orders. In theory I could use a group by-query to get

Re: SQL UPDATE fires on non-primitive values

2014-06-18 Thread Mark Stobbe
” commits. The relevant code is in org.apache.cayenne.access.ObjectDiff.isNoop: https://github.com/apache/cayenne/blob/master/cayenne-server/src/main/java/org/apache/cayenne/access/ObjectDiff.java Andrus On Jun 18, 2014, at 12:03 AM, Mark Stobbe markstobb...@gmail.com wrote: Hi, I

SQL UPDATE fires on non-primitive values

2014-06-17 Thread Mark Stobbe
Hi, I have a decimal column which is translated to a BigDecimal. When the value is equal to 0 and I set the value equal to 0 again, it will actually perform a SQL UPDATE. The two objects are ==, but they are equals. In the source I found in de PersistentObjectHolder.setValue the following: