|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.scooterframework.orm.activerecord.AssociatedRecordsInCategory
public class AssociatedRecordsInCategory
AssociatedRecordsInCategory class contains a list of ActiveRecord objects and its owner for a category.
Field Summary | |
---|---|
protected boolean |
latestRecordsLoaded
|
Constructor Summary | |
---|---|
AssociatedRecordsInCategory(ActiveRecord owner,
java.lang.String category,
java.lang.String type,
boolean refresh)
Owner record is the owner of the category association. |
Method Summary | |
---|---|
AssociatedRecordsInCategory |
add(ActiveRecord record)
Adds target record to the association. |
AssociatedRecordsInCategory |
add(ActiveRecord record,
java.util.Map<java.lang.String,java.lang.Object> joinInput)
Adds target record to the association. |
AssociatedRecordsInCategory |
add(java.util.List<? extends ActiveRecord> targets)
Adds a list of target records to the association. |
AssociatedRecordsInCategory |
add(java.util.List<? extends ActiveRecord> targets,
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> joinInputs)
Adds a list of target records to the association. |
AssociatedRecordsInCategory |
delete(ActiveRecord target)
Deletes target record from the association. |
AssociatedRecordsInCategory |
delete(java.util.List<? extends ActiveRecord> targets)
Deletes a list of target records from the association. |
AssociatedRecordsInCategory |
detach(ActiveRecord target)
Detaches target record from the association. |
AssociatedRecordsInCategory |
detach(ActiveRecord target,
boolean keepJoinRecord)
Detaches target record from the association. |
AssociatedRecordsInCategory |
detach(java.util.List<? extends ActiveRecord> targets)
Detaches a list of target records from the association. |
AssociatedRecordsInCategory |
detach(java.util.List<? extends ActiveRecord> targets,
boolean keepJoinRecord)
Detaches a list of target records from the association. |
AssociatedRecords |
getAssociatedRecordsByType(java.lang.String type)
Returns AssociatedRecords of a type. |
java.lang.String |
getCategory()
Returns category. |
Category |
getCategoryInstance()
Returns category instance. |
ActiveRecord |
getOwner()
Returns owner of the association. |
ActiveRecord |
getRecord(java.lang.String type,
int index)
Returns a specific associated record at index from the list for a specific type. |
java.util.List<ActiveRecord> |
getRecords()
Returns the associated records for all types. |
java.util.List<ActiveRecord> |
getRecords(boolean refresh)
Returns the associated records of all types. |
java.util.List<ActiveRecord> |
getRecords(java.lang.String type)
Returns the associated records of a particular type. |
java.util.List<ActiveRecord> |
getRecords(java.lang.String type,
boolean refresh)
Returns the associated records of a particular type. |
boolean |
isEmpty()
Return true if this list contains no elements. |
int |
size()
Returns the number of associated objects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean latestRecordsLoaded
Constructor Detail |
---|
public AssociatedRecordsInCategory(ActiveRecord owner, java.lang.String category, java.lang.String type, boolean refresh)
owner
- owner record of the categorycategory
- name of the categorytype
- specific record type in the categoryrefresh
- true if retrieving data from databaseMethod Detail |
---|
public AssociatedRecords getAssociatedRecordsByType(java.lang.String type)
type
- type name in the category
public ActiveRecord getRecord(java.lang.String type, int index)
type
- type name in the categoryindex
- index position of the record
public java.util.List<ActiveRecord> getRecords()
public java.util.List<ActiveRecord> getRecords(boolean refresh)
refresh
- true if database records are to be relaoded.
public java.util.List<ActiveRecord> getRecords(java.lang.String type)
type
- type name in the category
public java.util.List<ActiveRecord> getRecords(java.lang.String type, boolean refresh)
type
- type name in the category
public ActiveRecord getOwner()
public java.lang.String getCategory()
public Category getCategoryInstance()
public boolean isEmpty()
public int size()
public AssociatedRecordsInCategory add(ActiveRecord record)
record
- a record to be added to the association.
public AssociatedRecordsInCategory add(ActiveRecord record, java.util.Map<java.lang.String,java.lang.Object> joinInput)
record
- a record to be added to the association.joinInput
- A map of input data for the join record.
public AssociatedRecordsInCategory add(java.util.List<? extends ActiveRecord> targets)
targets
- a list of target record to be added to the association.
public AssociatedRecordsInCategory add(java.util.List<? extends ActiveRecord> targets, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> joinInputs)
targets
- a list of target record to be added to the association.joinInputs
- a list of input data map for the through table.
public AssociatedRecordsInCategory delete(ActiveRecord target)
target
- a record to be deleted from the association.
public AssociatedRecordsInCategory delete(java.util.List<? extends ActiveRecord> targets)
targets
- a list of target record to be deleted from the association.
public AssociatedRecordsInCategory detach(ActiveRecord target)
target
- a record to be detached from the association.
public AssociatedRecordsInCategory detach(ActiveRecord target, boolean keepJoinRecord)
target
- a record to be detached from the association.keepJoinRecord
- if true, keep the join record. Otherwise, delete it.
public AssociatedRecordsInCategory detach(java.util.List<? extends ActiveRecord> targets)
targets
- a list of target record to be deleted from the association.
public AssociatedRecordsInCategory detach(java.util.List<? extends ActiveRecord> targets, boolean keepJoinRecord)
targets
- a list of target record to be deleted from the association.keepJoinRecord
- if true, keep the join record. Otherwise, delete it.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |