com.wideplay.warp.persist
Class PersistenceService

java.lang.Object
  extended by com.wideplay.warp.persist.PersistenceService

public abstract class PersistenceService
extends java.lang.Object

Created with IntelliJ IDEA. On: 2/06/2007

This is the core warp-persist artifact. It providers factories for generating guice modules for your persistence configuration. It also must be injected into your code later as a service abstraction for starting the underlying persistence engine (Hibernate or JPA).

Since:
1.0
Author:
Dhanji R. Prasanna (dhanji@gmail.com)

Constructor Summary
PersistenceService()
           
 
Method Summary
static boolean isDynamicFinder(java.lang.reflect.Method method)
          A utility for testing if a given method is a dynamic finder.
abstract  void start()
          Starts the underlying persistence engine and makes warp-persist ready for use.
static SessionStrategyBuilder usingDb4o()
          A factory for warp-persist using Db4o in your Guice module.
static SessionStrategyBuilder usingHibernate()
          A factory for warp-persist using Hibernate in your Guice module.
static SessionStrategyBuilder usingJpa()
          A factory for warp-persist using JPA in your Guice module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceService

public PersistenceService()
Method Detail

start

public abstract void start()
Starts the underlying persistence engine and makes warp-persist ready for use. For instance, with hibernate, it creates a SessionFactory and may open connection pools. This method *must* be called by your code prior to using any warp-persist or hibernate artifacts.


usingHibernate

public static SessionStrategyBuilder usingHibernate()
A factory for warp-persist using Hibernate in your Guice module. See http://www.wideplay.com for proper documentation on the EDSL.

Returns:
Returns the next step in the configuration chain.

usingJpa

public static SessionStrategyBuilder usingJpa()
A factory for warp-persist using JPA in your Guice module. See http://www.wideplay.com for proper documentation on the EDSL. Any compliant implementation of JPA is supported (in theory). Currently, TopLink, Hibernate and OpenJPA have shown positive results.

Returns:
Returns the next step in the configuration chain.

isDynamicFinder

public static boolean isDynamicFinder(java.lang.reflect.Method method)
A utility for testing if a given method is a dynamic finder.

Parameters:
method - A method you suspect is a Dynamic Finder.
Returns:
Returns true if the method is annotated @Finder

usingDb4o

public static SessionStrategyBuilder usingDb4o()
A factory for warp-persist using Db4o in your Guice module. See http://www.wideplay.com for proper documentation on the EDSL. Note that Db4o has slightly different semantics than ORM frameworks like Hibernate and JPA. Consult the documentation carefully.

Returns:
Returns the next step in the configuration chain.