ciroanacleto / hibernate-generic-dao

Automatically exported from code.google.com/p/hibernate-generic-dao
0 stars 0 forks source link

How about a uniqueResult method and adding some column operators to Search? #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Provide a method on the daos for passing in a search and returning a single
result. It would throw an error if the query returns more than one result.
Perhaps it should return null if 0 results are returned.

Then add options to the Search object for column operators. Maybe call it
"summary" and specify a column and an operator. maybe COUNT, SUM, AVG, MAX,
MIN column operators.

The unique result could also be used for searches that have no column
operator but the user expects to return a single result.

Original issue reported on code.google.com by dwolvert on 21 Aug 2008 at 4:14

GoogleCodeExporter commented 9 years ago
also COUNT_DISTINCT

Original comment by dwolvert on 21 Aug 2008 at 4:22

GoogleCodeExporter commented 9 years ago
GenericDAO, GeneralDAO and RemoteDAO now each have a searchUnique method. This 
change
is introduced in 0.2.0.

The column operators will come soon.

Original comment by dwolvert on 21 Aug 2008 at 9:14

GoogleCodeExporter commented 9 years ago
build 0.2.0 Allows Fetches to take an additional "operator" property. This takes
values: COUNT, SUM, AVG, MAX, COUNT_DISTINCT.

Original comment by dwolvert on 22 Aug 2008 at 2:40