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. LocalEMF
  2. ScalaEMFactory
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
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. final def !=(arg0: AnyRef): Boolean

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

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

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

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

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

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.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. final def eq(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    AnyRef → Any
  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. final def isInstanceOf[T0]: Boolean

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

    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. final def notify(): Unit

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

    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. final def synchronized[T0](arg0: ⇒ T0): T0

    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. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from ScalaEMFactory

Inherited from AnyRef

Inherited from Any

Ungrouped