com.anji.persistence
Class HibernatePersistence

java.lang.Object
  extended by com.anji.persistence.HibernatePersistence
All Implemented Interfaces:
Persistence, Configurable

public class HibernatePersistence
extends java.lang.Object
implements Persistence

Author:
Philip Tucker

Field Summary
 
Fields inherited from interface com.anji.persistence.Persistence
PERSISTENCE_CLASS_KEY
 
Constructor Summary
HibernatePersistence()
          default ctor; must call init() before using this object
 
Method Summary
 void deleteChromosome(java.lang.String id)
          delete chromosome identified by by id
 void init(Properties props)
          See Parameter Details for specific property settings.
 Chromosome loadChromosome(java.lang.String id, Configuration config)
           
 Genotype loadGenotype(Configuration aConfig)
          loads genotype as of latest generation in run
 void reset()
          remove all data from storage
 void startRun(java.lang.String aRunId)
          Begin run.
 void store(Activator a)
           
 void store(Chromosome c)
           
 void store(Run r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernatePersistence

public HibernatePersistence()
default ctor; must call init() before using this object

Method Detail

init

public void init(Properties props)
Description copied from interface: Persistence
See Parameter Details for specific property settings.

Specified by:
init in interface Persistence
Specified by:
init in interface Configurable
Parameters:
props - configuration parameters
See Also:
Configurable.init(com.anji.util.Properties)

reset

public void reset()
Description copied from interface: Persistence
remove all data from storage

Specified by:
reset in interface Persistence
See Also:
Persistence.reset()

store

public void store(Chromosome c)
           throws java.lang.Exception
Specified by:
store in interface Persistence
Parameters:
c - chromosome to store
Throws:
java.lang.Exception
See Also:
Persistence.store(org.jgap.Chromosome)

store

public void store(Activator a)
           throws java.lang.Exception
Specified by:
store in interface Persistence
Parameters:
a - activator to store
Throws:
java.lang.Exception
See Also:
Persistence.store(com.anji.integration.Activator)

store

public void store(Run r)
           throws java.lang.Exception
Specified by:
store in interface Persistence
Parameters:
r - run to store
Throws:
java.lang.Exception
See Also:
Persistence.store(com.anji.run.Run)

loadChromosome

public Chromosome loadChromosome(java.lang.String id,
                                 Configuration config)
Specified by:
loadChromosome in interface Persistence
Returns:
chromosome from persistence
See Also:
Persistence.loadChromosome(java.lang.String, org.jgap.Configuration)

deleteChromosome

public void deleteChromosome(java.lang.String id)
                      throws java.lang.Exception
Description copied from interface: Persistence
delete chromosome identified by by id

Specified by:
deleteChromosome in interface Persistence
Parameters:
id - id of chromosome to delete
Throws:
java.lang.Exception
See Also:
Persistence.deleteChromosome(java.lang.String)

loadGenotype

public Genotype loadGenotype(Configuration aConfig)
Description copied from interface: Persistence
loads genotype as of latest generation in run

Specified by:
loadGenotype in interface Persistence
Returns:
genotype; null if there is no previous run
See Also:
Persistence.loadGenotype(org.jgap.Configuration)

startRun

public void startRun(java.lang.String aRunId)
Description copied from interface: Persistence
Begin run. All successive calls to this persistance object will be in the context of this run.

Specified by:
startRun in interface Persistence
See Also:
Persistence.startRun(java.lang.String)