Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Active Objects, how to sum a numeric column

Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 17, 2012

Im guessing this can't be done right now, someone correct me if Im wrong, this older post shows count() operators, exposed by AO, but there is no sum() operator.

https://answers.atlassian.com/questions/24246/active-objects-is-it-possible-to-get-count-using-group-by-in-ao

Without reading all data, how to SUM a numeric column in a table?

2 answers

1 accepted

0 votes
Answer accepted
Samuel Le Berrigaud
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2012

You're right Andy, no way to do SUM columns at the moment. Active Objects works on Objects, and doesn't allow (at the moment) working on individual columns to compute values.

Feel free to raise a feature request though, http://studio.atlassian.com/browse/AO

Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 29, 2012
2 votes
tousifs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 28, 2012

Hi,

At the movement i can-not give you any Active Objects Example

but using hibernate it is possible eg. Long sum = Projections.sum("Name of column");

Active object is similar you can try this may be it will work.

Nikolay October 27, 2015

I am not familar to hibernate, what's Projections?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events