org.specrunner.hibernate
Class PluginHibernate

java.lang.Object
  extended by org.specrunner.parameters.core.ParameterHolder
      extended by org.specrunner.plugins.core.AbstractPlugin
          extended by org.specrunner.plugins.core.AbstractPluginNamed
              extended by org.specrunner.plugins.core.AbstractPluginScoped
                  extended by org.specrunner.plugins.core.AbstractPluginTable
                      extended by org.specrunner.plugins.core.objects.AbstractPluginObject
                          extended by org.specrunner.hibernate.PluginHibernate
All Implemented Interfaces:
IParameterHolder, IActionType, IParalelPlugin, IPlugin, ISleepPlugin, ITestPlugin, ITimedPlugin, IWaitPlugin
Direct Known Subclasses:
PluginInsert

public abstract class PluginHibernate
extends AbstractPluginObject

Generic Hibernate plugin. To write Hibernate plugins override method isMapped() and action(...).

Author:
Thiago Santos

Nested Class Summary
 
Nested classes/interfaces inherited from class org.specrunner.plugins.core.objects.AbstractPluginObject
AbstractPluginObject.Field
 
Field Summary
 
Fields inherited from class org.specrunner.plugins.core.objects.AbstractPluginObject
creator, creatorInstance, fields, fieldToFields, headerToFields, instances, keysBefore, mapping, reference, references, separator, type, typeInstance
 
Fields inherited from class org.specrunner.plugins.core.AbstractPlugin
FEATURE_CONDITION, FEATURE_NORMALIZED, FEATURE_SLEEP, FEATURE_THREADSAFE, FEATURE_TIMEOUT, FEATURE_WAIT
 
Constructor Summary
PluginHibernate()
           
 
Method Summary
protected  void action(IContext context, Object instance, RowAdapter row, IResultSet result)
          Process a Hibernate action.
protected abstract  void action(IContext context, Object instance, RowAdapter row, IResultSet result, org.hibernate.SessionFactory sf)
          This method can be and should be overridden to perform save, comparison, etc for updates.
 String getConfiguration()
          The configuration name.
 void setConfiguration(String configuration)
          Set configuration name.
 
Methods inherited from class org.specrunner.plugins.core.objects.AbstractPluginObject
create, doEnd, getCreator, getCreatorInstance, getMapping, getObject, getReference, getSeparator, getType, getTypeInstance, initialize, isMapped, loadFields, loadMapping, makeKey, mapObject, merge, populate, processLine, removeObject, setBoolean, setChar, setCreator, setCreatorInstance, setDouble, setEntity, setFloat, setInteger, setLong, setMapping, setObject, setObjectInformation, setReference, setSeparator, setShort, setType, setTypeInstance, setValue
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginTable
doEnd, doStart, doStart, initialize, toString
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginScoped
getScope, saveGlobal, saveLocal, saveStrict, setScope
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginNamed
getName, setName
 
Methods inherited from class org.specrunner.plugins.core.AbstractPlugin
copy, getCondition, getConditionModel, getNormalized, getNormalized, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, setCondition, setConditionModel, setNormalized, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel
 
Methods inherited from class org.specrunner.parameters.core.ParameterHolder
getParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.specrunner.parameters.IParameterHolder
getParameters, setParameters
 
Methods inherited from interface org.specrunner.plugins.IActionType
getActionType
 

Constructor Detail

PluginHibernate

public PluginHibernate()
Method Detail

getConfiguration

public String getConfiguration()
The configuration name.

Returns:
The name.

setConfiguration

public void setConfiguration(String configuration)
Set configuration name.

Parameters:
configuration - The name.

action

protected void action(IContext context,
                      Object instance,
                      RowAdapter row,
                      IResultSet result)
               throws Exception
Process a Hibernate action.

Specified by:
action in class AbstractPluginObject
Parameters:
context - The context.
instance - The instance ready to use. All object where set, and related objects assembled.
row - The row.
result - The result set.
Throws:
Exception - On processing errors.

action

protected abstract void action(IContext context,
                               Object instance,
                               RowAdapter row,
                               IResultSet result,
                               org.hibernate.SessionFactory sf)
                        throws Exception
This method can be and should be overridden to perform save, comparison, etc for updates.

Parameters:
context - The test context.
instance - The object instance.
row - The row of object.
result - The result set.
sf - The session factory.
Throws:
Exception - On exception errors.


Copyright © 2014. All rights reserved.