public abstract class DbRelsCommons<E> extends Object implements DbRelationInternals, org.rapidoid.beany.SerializableBean<Map<String,Object>>, Comparable<DbRelsCommons<E>>
| Modifier and Type | Field and Description |
|---|---|
protected org.rapidoidx.db.Database |
db |
protected Object |
holder |
protected String |
name |
protected DbRelChangesTracker |
tracker |
| Constructor and Description |
|---|
DbRelsCommons(org.rapidoidx.db.Database db,
Object holder,
String relation,
Collection<Long> ids) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addId(long id) |
protected boolean |
addIdAt(int index,
long id) |
protected boolean |
addIdsAt(int index,
Collection<Long> idsToAdd) |
void |
addIdWithoutTracking(long id) |
void |
clear() |
int |
compareTo(DbRelsCommons<E> rel) |
void |
deserializeBean(Map<String,Object> serialized) |
boolean |
equals(Object obj) |
Set<Long> |
getAddedRelations() |
Object |
getHolder() |
protected long |
getIdAt(int index) |
protected List<Long> |
getIdSublist(int fromIndex,
int toIndex) |
Collection<Long> |
getIdsView() |
String |
getName() |
Set<Long> |
getRemovedRelations() |
protected long |
getSingleId() |
int |
hashCode() |
boolean |
hasId(long id) |
protected int |
indexOfId(long id) |
protected void |
initId(long id) |
protected void |
initIds(Collection<? extends Number> initIds) |
boolean |
isEmpty() |
protected int |
lastIndexOfId(long id) |
protected List<E> |
records() |
boolean |
removeId(long id) |
protected long |
removeIdAt(int index) |
void |
removeIdWithoutTracking(long id) |
protected boolean |
retainIds(Collection<Long> retainIds) |
Map<String,Object> |
serializeBean() |
void |
setHolder(Object holder) |
protected long |
setIdAt(int index,
long id) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] arr) |
String |
toString() |
protected final org.rapidoidx.db.Database db
protected Object holder
protected String name
protected final DbRelChangesTracker tracker
public DbRelsCommons(org.rapidoidx.db.Database db,
Object holder,
String relation,
Collection<Long> ids)
protected void initIds(Collection<? extends Number> initIds)
protected void initId(long id)
public void setHolder(Object holder)
setHolder in interface DbRelationInternalspublic Object getHolder()
public String getName()
public Set<Long> getAddedRelations()
getAddedRelations in interface DbRelationInternalspublic Set<Long> getRemovedRelations()
getRemovedRelations in interface DbRelationInternalspublic void addIdWithoutTracking(long id)
public void removeIdWithoutTracking(long id)
protected long getSingleId()
public boolean isEmpty()
public int size()
public boolean hasId(long id)
hasId in interface DbRelationInternalspublic Object[] toArray()
public <T> T[] toArray(T[] arr)
protected long getIdAt(int index)
protected int indexOfId(long id)
protected int lastIndexOfId(long id)
public void clear()
public boolean addId(long id)
addId in interface DbRelationInternalspublic boolean removeId(long id)
removeId in interface DbRelationInternalsprotected boolean retainIds(Collection<Long> retainIds)
protected boolean addIdAt(int index,
long id)
protected boolean addIdsAt(int index,
Collection<Long> idsToAdd)
protected long removeIdAt(int index)
protected long setIdAt(int index,
long id)
public Collection<Long> getIdsView()
public int compareTo(DbRelsCommons<E> rel)
compareTo in interface Comparable<DbRelsCommons<E>>Copyright © 2014–2015 Nikolche Mihajlovski and contributors. All rights reserved.