ariba.ui.meta.persistence
Class ObjectContextDataSource

java.lang.Object
  extended by ariba.ui.table.AWTDataSource
      extended by ariba.ui.meta.persistence.ObjectContextDataSource

public class ObjectContextDataSource
extends AWTDataSource


Constructor Summary
ObjectContextDataSource(java.lang.Class entityClass)
           
 
Method Summary
static SortOrdering createSortOrdering(AWTSortOrdering ordering)
           
static java.util.List<SortOrdering> createSortOrderings(java.util.List<AWTSortOrdering> orderings)
           
 boolean dataSourceDoesSort()
          Apps that wish to sort in the database and *re-fetch* upon a user sort change should do so by implementing a AWTDataSource subclass and binding that to the AWTDisplayGroup for their table.
 void delete(java.lang.Object object)
           
 boolean doSortInQuery()
           
 java.util.List fetchObjects()
          Returns the list of objects.
 java.lang.Class getEntityClass()
           
 QuerySpecification getQuerySpecification()
           
 boolean hasChanges()
          Should return true when underlying changes in the datasource indicate that the DisplayGroup should automatcally call fetchObjects() as soon as possible to present the user with recent changes.
 java.lang.Object insert()
           
 void setDoSortInQuery(boolean doSortInQuery)
           
 void setEntityClass(java.lang.Class entityClass)
           
 void setQuerySpecification(QuerySpecification querySpecification)
           
 void setSortOrderings(java.util.List<AWTSortOrdering> orderings)
           
 
Methods inherited from class ariba.ui.table.AWTDataSource
entity
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectContextDataSource

public ObjectContextDataSource(java.lang.Class entityClass)
Method Detail

fetchObjects

public java.util.List fetchObjects()
Description copied from class: AWTDataSource
Returns the list of objects. Should list should be sorted if dataSourceDoesSort() has been overridden to return true

Specified by:
fetchObjects in class AWTDataSource
Returns:
array of fetched objects

setSortOrderings

public void setSortOrderings(java.util.List<AWTSortOrdering> orderings)
Overrides:
setSortOrderings in class AWTDataSource

doSortInQuery

public boolean doSortInQuery()

setDoSortInQuery

public void setDoSortInQuery(boolean doSortInQuery)

dataSourceDoesSort

public boolean dataSourceDoesSort()
Description copied from class: AWTDataSource
Apps that wish to sort in the database and *re-fetch* upon a user sort change should do so by implementing a AWTDataSource subclass and binding that to the AWTDisplayGroup for their table. When using a DataSource, the app should *not* assign objects directly to the DisplayGroup via setObjectArray(), *nor* should it use the DataTable's `list` binding. Instead, it should rely on the DataSource's fetch method to return the (sorted) list of objects.

Overrides:
dataSourceDoesSort in class AWTDataSource
Returns:
whether data source fetchObjects() method will return objects sorted according the most recent sort order set via setSortOrderings()

insert

public java.lang.Object insert()
Overrides:
insert in class AWTDataSource

delete

public void delete(java.lang.Object object)
Overrides:
delete in class AWTDataSource

hasChanges

public boolean hasChanges()
Description copied from class: AWTDataSource
Should return true when underlying changes in the datasource indicate that the DisplayGroup should automatcally call fetchObjects() as soon as possible to present the user with recent changes. Datasources for which fetching is not "free" should override this method to return false either always, or at least unless a special event has occured that indicates re-performing a fetch is warrented.

Overrides:
hasChanges in class AWTDataSource
Returns:
true if a fetch should be triggered immediately.

getEntityClass

public java.lang.Class getEntityClass()

setEntityClass

public void setEntityClass(java.lang.Class entityClass)

getQuerySpecification

public QuerySpecification getQuerySpecification()

setQuerySpecification

public void setQuerySpecification(QuerySpecification querySpecification)

createSortOrdering

public static SortOrdering createSortOrdering(AWTSortOrdering ordering)

createSortOrderings

public static java.util.List<SortOrdering> createSortOrderings(java.util.List<AWTSortOrdering> orderings)


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.