Package play.db.jpa

Class JPABase

  • All Implemented Interfaces:
    java.io.Serializable, Model
    Direct Known Subclasses:
    GenericModel

    @MappedSuperclass
    public class JPABase
    extends java.lang.Object
    implements java.io.Serializable, Model
    A super class for JPA entities
    See Also:
    Serialized Form
    • Field Detail

      • willBeSaved

        public transient boolean willBeSaved
    • Constructor Detail

      • JPABase

        public JPABase()
    • Method Detail

      • _save

        public void _save()
        Specified by:
        _save in interface Model
      • _delete

        public void _delete()
        Specified by:
        _delete in interface Model
      • _key

        public java.lang.Object _key()
        Specified by:
        _key in interface Model
      • em

        public static javax.persistence.EntityManager em​(java.lang.String name)
        Retrieve the current entityManager
        Parameters:
        name - The DB name
        Returns:
        the current entityManager
      • em

        public static javax.persistence.EntityManager em()
      • isPersistent

        public boolean isPersistent​(java.lang.String name)
      • isPersistent

        public boolean isPersistent()
      • equals

        public boolean equals​(java.lang.Object other)
        JPASupport instances a and b are equals if either a == b or a and b have same key and class
        Overrides:
        equals in class java.lang.Object
        Parameters:
        other - The object to compare to
        Returns:
        true if equality condition above is verified
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getEntityId

        @Deprecated
        public java.lang.Object getEntityId()
        Deprecated.