com.atlassian.jira.entity
Class Select

java.lang.Object
  extended by com.atlassian.jira.entity.Select

public class Select
extends Object

Select is the entry point to building up a SelectQuery which can be run in OfBiz Entity Engine.

eg

 SelectQuery<GenericValue> query = Select.columns().from("FilterSubscription")
      .whereEqual("group", (String) null).andEqual("username", username)
      .orderBy("id desc");
 
 

If you are selecting a single column, then you can it can return String objects instead of GenericValues like

 SelectQuery<String> query = Select.distinctString("username").from("FilterSubscription");
 List<String> vals = query.runWith(delegator).asList();
 
 

You can also use an EntityFactory to automatically convert the GenericValues to other entity objects.

 List<ProjectCategory> categories = Select.from(Entity.PROJECT_CATEGORY).runWith(delegator).asList();
 
 

Since:
v5.2

Nested Class Summary
static class Select.OrderByContext<E>
           
static class Select.SelectColumnsContext
           
static class Select.SelectColumnsFromContext<E>
           
static class Select.SelectSingleColumnContext<E>
           
static class Select.WhereContext<E>
           
 
Constructor Summary
Select()
           
 
Method Summary
static Select.SelectColumnsContext columns(String... columns)
           
static Select.SelectColumnsContext distinct(String... columns)
           
static Select.SelectSingleColumnContext<String> distinctString(String columnName)
           
static
<E> Select.SelectColumnsFromContext<E>
from(NamedEntityBuilder<E> entityFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Select

public Select()
Method Detail

columns

public static Select.SelectColumnsContext columns(String... columns)

distinct

public static Select.SelectColumnsContext distinct(String... columns)

distinctString

public static Select.SelectSingleColumnContext<String> distinctString(String columnName)

from

public static <E> Select.SelectColumnsFromContext<E> from(NamedEntityBuilder<E> entityFactory)


Copyright © 2002-2013 Atlassian. All Rights Reserved.