|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.entity.EntityEngineImpl
public class EntityEngineImpl
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.atlassian.jira.entity.EntityEngine |
|---|
EntityEngine.SelectFromContext<E>, EntityEngine.WhereContext<E>, EntityEngine.WhereEqualAndContext<E>, EntityEngine.WhereEqualContext<E> |
| Constructor Summary | |
|---|---|
EntityEngineImpl(OfBizDelegator ofBizDelegator)
|
|
| Method Summary | ||
|---|---|---|
|
createValue(EntityFactory<E> entityFactory,
E value)
|
|
int |
delete(Delete.DeleteWhereContext deleteContext)
Allows you to execute an SQL DELETE using a fluent interface. |
|
int |
execute(Update.WhereContext updateContext)
Allows you to execute an UPDATE statement using a fluent interface. |
|
|
removeValue(EntityFactory<E> entityFactory,
Long id)
Remove the given entity from the DB. |
|
|
selectFrom(EntityFactory<E> entity)
Starts a dialog to run a SELECT query against EntityEngine. |
|
|
updateValue(EntityFactory<E> entityFactory,
E newValue)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EntityEngineImpl(OfBizDelegator ofBizDelegator)
| Method Detail |
|---|
public <E> E createValue(EntityFactory<E> entityFactory,
E value)
createValue in interface EntityEngine
public <E> void updateValue(EntityFactory<E> entityFactory,
E newValue)
updateValue in interface EntityEnginepublic int execute(Update.WhereContext updateContext)
EntityEngine
See the Update class for an example.
execute in interface EntityEngineupdateContext - build up a fluent UPDATE statement here. Should start with Update.into(
public int delete(Delete.DeleteWhereContext deleteContext)
EntityEngineYou should call this using code that looks like:
entityEngine.delete(Delete.from(Entity.ISSUE_SECURITY_LEVEL).whereIdEquals(securityLevelId));
or:
entityEngine.delete(
Delete.from(Entity.ISSUE_SECURITY_LEVEL)
.whereEqual("scheme", schemeId)
.andEqual("name", name)
);
delete in interface EntityEnginedeleteContext - build up a fluent DELETE statement here. Should start with Delete.from(
public <E> int removeValue(EntityFactory<E> entityFactory,
Long id)
EntityEngine
removeValue in interface EntityEngineentityFactory - represents the entity type (ie TABLE)id - the id of the row to delete.
public <E> EntityEngine.SelectFromContext<E> selectFrom(EntityFactory<E> entity)
EntityEnginee.g. to run "SELECT * FROM remotelink WHERE id = ?" (and return a single entity value) you could write:
RemoteIssueLink link = entityEngine.selectFrom(Entity.REMOTE_ISSUE_LINK)
.whereEqual("id", remoteIssueLinkId)
.singleValue();
e.g. to run "SELECT * FROM remotelink WHERE issueid = ? AND app = ? ORDER BY type" you could write:
ListremoteIssueLinks = entityEngine.selectFrom(Entity.REMOTE_ISSUE_LINK) .whereEqual("issueid", issueId) .andEqual("app", app) .orderBy("type");
- Specified by:
selectFromin interfaceEntityEngine
- Type Parameters:
E- Entity Data Object type.- Parameters:
entity- that can convert GenericValues into Entity data objects. SeeEntityfor existing factories.- Returns:
- The context that begins a fluent dialog to run a SELECT query.
- See Also:
Entity
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||