Enhancement 353 : Partial queries that return List of Attribute type
Priority 
Medium
Reported Version 
 
Logged By 
Paul
Status 
Fixed
Fixed Version 
github
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
17/02/2011
Updated 
17/02/2011
Type 
Enhancement
 
Attachments 
No attachments

Consider a simple table User;

@entity
Public class User {
integer user_id;
String user_name;
String email;
}

Using ebean today I can write the following code

List l=Ebean.find(User.class).fetch("email").where(...).orderBy(...).findList();

This code will only populate the email member ititially.

What I really would like to do is

List l2=Ebean.find(User.class).fetch("email").where(...).orderBy(...).findSingleAttributeList();

In which the type of the list will be the class of the attribute designeted in the fetch(...) parameter.

 
Paul 19 Feb 03:12
Query Correction

The actual query I meant was

List l=Ebean.find(User.class).select("email").where(...).orderBy(...).findList();

and

List l2=Ebean.find(User.class).select("email").where(...).orderBy(...).findSingleAttributeList();

woResponse

Upload a file