Re: How to use a custom aggregate function?

2024-01-05 Thread Mark Stobbe
om SQLTreeProcessor > (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

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 it

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 my_detai

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 > > > > was retur

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 ("snapshot.containsKey(d

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 set

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 query

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
e.org/jira/browse/CAY-2141 > > > On Nov 14, 2016, at 11:25 PM, Mark Stobbe > wrote: > > > > Hi Andrus, > > > > Version 3.2M1. Relationship would be a normal to-one yes. I am executing > a > > query for the first 25 records of "djem_us

Re: Disjoint by id

2016-11-14 Thread Mark Stobbe
doesn't look right. What version of Cayenne is this? And what is the > relationship semantics? Is this a regular to-one? > > Andrus > > > On Nov 14, 2016, at 6:02 PM, Mark Stobbe wrote: > > > > Hi, > > > > I was wondering if this is correct: > &g

Disjoint by id

2016-11-14 Thread Mark Stobbe
= 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 ) 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 t

Re: Updating totals in a multi-user environment

2014-11-02 Thread Mark Stobbe
iple issues by using its *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 wrote: > Thank you Andrus! > I managed to get mo

Re: Updating totals in a multi-user environment

2014-11-01 Thread Mark Stobbe
tter abstraction then > SQLTemplate for instance. (And its integration into SelectQuery is on the > agenda). > > Andrus > > > > On Oct 31, 2014, at 1:38 AM, Mark Stobbe wrote: > > > > @Andrus, I see. Good to know how to do this in Cayenne. > > > > @Mi

Re: Updating totals in a multi-user environment

2014-10-30 Thread Mark Stobbe
, and MAX ... > > >> On Thu, Oct 30, 2014 at 12:35 PM, Mark Stobbe wrote: >> Oh, I also have the same problem with total cost with different >> currencies... >> >>> On Thu, Oct 30, 2014 at 5:09 PM, Mark Stobbe wrote: >>> >>> Hi Michael, >>

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 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: Updating totals in a multi-user environment

2014-10-30 Thread Mark Stobbe
lifecycle listeners, datachannel filters and such? Mark On Thu, Oct 30, 2014 at 4:15 PM, Michael Gentry 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

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 the

Re: NEWBEE, first time using Cayenne

2014-09-12 Thread Mark Stobbe
Yea, that's correct. Just add the PostgreSQL JDBC driver to the classpath, restart cayenne modeler and you are good to go. Make sure the url points to the correct database and make sure the database exists. On Fri, Sep 12, 2014 at 11:33 AM, Alonso Isidoro Roman wrote: > Hi, i have just downlo

Re: SQL UPDATE fires on non-primitive values

2014-06-18 Thread Mark Stobbe
un 18, 2014 at 3:13 PM, Andrus Adamchik wrote: > How do you set the values? > > object.setXyz(new BigDecimal(..)) ? > > On Jun 18, 2014, at 3:56 PM, Mark Stobbe wrote: > > > Thank you for the link to the code that does the check. > > > > I figured out that if

Re: SQL UPDATE fires on non-primitive values

2014-06-18 Thread Mark Stobbe
mits. 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 wrote: >

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: Ob

Re: AuditableFilter constructor

2014-03-10 Thread Mark Stobbe
3.2. > > > > Andrus > > > > > > [1] > https://github.com/andrus/wowodc13/blob/master/editor/src/main/java/demo/editor/services/cayenne/EditorCayenneService.java > > > > > > On Mar 7, 2014, at 12:52 PM, Mark Stobbe wrote: > > >

AuditableFilter constructor

2014-03-07 Thread Mark Stobbe
Hi all, The AuditableFilter constructor required an entityResolver to be passed. However, when I am initializing the module there is no way to grab this entityResolver just yet. After careful inspection I noticed that it is not needed during construction, but only later. Could anyone tell me why