Package 

Interface PanacheEntityBase


  • 
    public interface PanacheEntityBase
    
                        

    Represents an entity. If your Hibernate entities extend this class they gain auto-generated accessors to all their public fields (unless annotated with Transient), as well as a lot of useful methods. Unless you have a custom ID strategy, you should not extend this class directly but extend PanacheEntity instead.

    • Method Summary

      Modifier and Type Method Description
      Boolean isPersistent() Returns true if this entity is persistent in the database.
      Unit persist() Persist this entity in the database, if not already persisted.
      Unit persistAndFlush() Persist this entity in the database, if not already persisted.
      Unit delete() Delete this entity from the database, if it is already persisted.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isPersistent

         Boolean isPersistent()

        Returns true if this entity is persistent in the database. If yes, all modifications to its persistent fields will be automatically committed to the database at transaction commit time.

      • persist

         Unit persist()

        Persist this entity in the database, if not already persisted. This will set your ID field if it is not already set.

      • persistAndFlush

         Unit persistAndFlush()

        Persist this entity in the database, if not already persisted. This will set your ID field if it is not already set. Then flushes all pending changes to the database.

      • delete

         Unit delete()

        Delete this entity from the database, if it is already persisted.