org.scala_libs.jpa

LocalEMF

class LocalEMF extends ScalaEMFactory

This class represents an EntityManager factory that is retrieved via the javax.persistence.Persistence factory class. Typically this is used in an environment that doesn't support JNDI. An example of usage would be:

object FooEM extends LocalEMF("foo")

...

def doSomething = {
  val em = FooEM.newEM
  ...
  em.close()
}

Linear Supertypes
ScalaEMFactory, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. LocalEMF
  2. ScalaEMFactory
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LocalEMF (unitName: String)

    Creates a new EM manager that handles its own transactions.

    Creates a new EM manager that handles its own transactions.

    unitName

    The persistence unit name that this EM should represent

  2. new LocalEMF (unitName: String, userTx: Boolean)

    Creates a new EM manager with the specified transaction management.

    Creates a new EM manager with the specified transaction management.

    * @param unitName The persistence unit name that this EM should represent

    userTx

    controls whether the user is responsible for handling transactions. true means that the user will begin and end transactions, false means that the LocalEM will handle it for the user.

  3. new LocalEMF (unitName: String, userTx: Boolean, properties: Map[_, _])

    Creates a new EM manager with the specified transaction management and configuration properties.

    Creates a new EM manager with the specified transaction management and configuration properties. This is a convenience constructor so that you're not required to pass an Option.

    unitName

    The persistence unit name that this EM should represent

    userTx

    controls whether the user is responsible for handling transactions. true means that the user will begin and end transactions, false means that the LocalEM will handle it for the user.

    properties

    A map containing additional properties to use when creating the factory.

  4. new LocalEMF (unitName: String, userTx: Boolean, properties: Option[Map[_, _]])

    unitName

    The persistence unit name that this EM should represent

    userTx

    controls whether the user is responsible for handling transactions. true means that the user will begin and end transactions, false means that the LocalEM will handle it for the user.

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. def closeEM (em: EntityManager): Unit

    Closes the underlying EM and handles the transaction if configured to do so.

    Closes the underlying EM and handles the transaction if configured to do so.

    em

    The EntityManager to close

    Definition Classes
    LocalEMFScalaEMFactory
  9. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  10. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef
  13. def getUnitName : String

    Return the name of the configured persistence unit name

    Return the name of the configured persistence unit name

    Definition Classes
    LocalEMFScalaEMFactory
  14. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  15. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  16. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  17. def newEM : ScalaEntityManager

    Returns a newly created ScalaEntityManager.

    Returns a newly created ScalaEntityManager. This is the method that clients would typically use to obtain their EM.

    returns

    A new ScalaEntityManager instance.

    Definition Classes
    ScalaEMFactory
  18. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  19. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  20. def openEM (): EntityManager

    Opens an EntityManager retrieved from the EntityManagerFactory for the given persistence unit.

    Opens an EntityManager retrieved from the EntityManagerFactory for the given persistence unit.

    returns

    An appropriately configured EntityManager

    Definition Classes
    LocalEMFScalaEMFactory
  21. def shutdownEMF : Unit

    Closes the underlying EMF.

    Closes the underlying EMF. This should be called to release any held resources to prevent memory leaks.

  22. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  23. def toString (): String

    Definition Classes
    AnyRef → Any
  24. val unitName : String

    The persistence unit name that this EM should represent

  25. val userTx : Boolean

    controls whether the user is responsible for handling transactions.

    controls whether the user is responsible for handling transactions. true means that the user will begin and end transactions, false means that the LocalEM will handle it for the user.

  26. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  28. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from ScalaEMFactory

Inherited from AnyRef

Inherited from Any