Class PanacheEntityBase

java.lang.Object
io.quarkiverse.groovy.hibernate.reactive.panache.PanacheEntityBase
Direct Known Subclasses:
PanacheEntity

public abstract class PanacheEntityBase extends Object

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.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.smallrye.mutiny.Uni<Void>
    Delete this entity from the database, if it is already persisted.
    io.smallrye.mutiny.Uni<Void>
    Flushes all pending changes to the database.
    static io.smallrye.mutiny.Uni<org.hibernate.reactive.mutiny.Mutiny.Session>
    Returns the current Mutiny.Session
    boolean
    Returns true if this entity is persistent in the database.
    <T extends PanacheEntityBase>
    io.smallrye.mutiny.Uni<T>
    Persist this entity in the database, if not already persisted.
    static io.smallrye.mutiny.Uni<Void>
    persist(Iterable<?> entities)
    Persist all given entities.
    static io.smallrye.mutiny.Uni<Void>
    persist(Object firstEntity, Object... entities)
    Persist all given entities.
    static io.smallrye.mutiny.Uni<Void>
    persist(Stream<?> entities)
    Persist all given entities.
    <T extends PanacheEntityBase>
    io.smallrye.mutiny.Uni<T>
    Persist this entity in the database, if not already persisted.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PanacheEntityBase

      public PanacheEntityBase()
  • Method Details

    • getSession

      public static io.smallrye.mutiny.Uni<org.hibernate.reactive.mutiny.Mutiny.Session> getSession()
      Returns the current Mutiny.Session
      Returns:
      the current Mutiny.Session
    • persist

      @CheckReturnValue public <T extends PanacheEntityBase> io.smallrye.mutiny.Uni<T> persist()
      Persist this entity in the database, if not already persisted. This will set your ID field if it is not already set.
      See Also:
    • persistAndFlush

      @CheckReturnValue public <T extends PanacheEntityBase> io.smallrye.mutiny.Uni<T> 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.
      See Also:
    • delete

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> delete()
      Delete this entity from the database, if it is already persisted.
      See Also:
    • isPersistent

      public 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.
      Returns:
      true if this entity is persistent in the database.
    • flush

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> flush()
      Flushes all pending changes to the database.
    • persist

      @CheckReturnValue @GenerateBridge(callSuperMethod=true) public static io.smallrye.mutiny.Uni<Void> persist(Iterable<?> entities)
      Persist all given entities.
      Parameters:
      entities - the entities to persist
      See Also:
    • persist

      @CheckReturnValue @GenerateBridge(callSuperMethod=true) public static io.smallrye.mutiny.Uni<Void> persist(Stream<?> entities)
      Persist all given entities.
      Parameters:
      entities - the entities to persist
      See Also:
    • persist

      @CheckReturnValue @GenerateBridge(callSuperMethod=true) public static io.smallrye.mutiny.Uni<Void> persist(Object firstEntity, Object... entities)
      Persist all given entities.
      Parameters:
      entities - the entities to persist
      See Also: