|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.liferay.portal.service.persistence.BatchSessionImpl
@Deprecated public class BatchSessionImpl
| Constructor Summary | |
|---|---|
BatchSessionImpl()
Deprecated. |
|
| Method Summary | |
|---|---|
void |
delete(Session session,
BaseModel<?> model)
Deprecated. Deletes the model instance in the database, and possibly flushes the session. |
boolean |
isEnabled()
Deprecated. Returns true if update batching is enabled |
void |
setEnabled(boolean enabled)
Deprecated. Sets whether update batching is enabled. |
void |
update(Session session,
BaseModel<?> model,
boolean merge)
Deprecated. Updates the model instance in the database or adds it if it does not yet exist, and possibly flushes the session. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BatchSessionImpl()
| Method Detail |
|---|
public void delete(Session session,
BaseModel<?> model)
throws ORMException
BatchSession
The session will be flushed if one of the following is true:
The batch size may be set in portal.properties with the key
hibernate.jdbc.batch_size.
delete in interface BatchSessionsession - the session to perform the update onmodel - the model instance to update
ORMExceptionpublic boolean isEnabled()
BatchSessiontrue if update batching is enabled
isEnabled in interface BatchSessiontrue if update batching is enabled;
false otherwisepublic void setEnabled(boolean enabled)
BatchSession
setEnabled in interface BatchSessionenabled - whether update batching is enabled.
public void update(Session session,
BaseModel<?> model,
boolean merge)
throws ORMException
BatchSession
The session will be flushed if one of the following is true:
The batch size may be set in portal.properties with the key
hibernate.jdbc.batch_size.
The merge parameter controls a special case of persistence.
If the session that a model instance was originally loaded from is
closed, that instance becomes "detached", and changes to it
will not be persisted automatically. To persist its changes, the detached
instance must be merged with the current session. This will load a new
copy of the model instance from the database, copy the changes to it, and
persist it.
This process is most commonly necessary if a model instance is modified
in the controller or view, as the database session is closed when control
leaves the model layer. However, local service update model methods use
merging by default, so in most cases this nuance is handled
automatically. See UserLocalService.updateUser(
com.liferay.portal.model.User) for an example.
update in interface BatchSessionsession - the sessionmodel - the model instancemerge - whether to merge the model instance with the current session
ORMException
|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||