Class PanacheEntityBase
- java.lang.Object
-
- io.quarkiverse.groovy.hibernate.orm.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 extendPanacheEntityinstead.- See Also:
PanacheEntity
-
-
Constructor Summary
Constructors Constructor Description PanacheEntityBase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()Delete this entity from the database, if it is already persisted.booleanisPersistent()Returns true if this entity is persistent in the database.voidpersist()Persist this entity in the database, if not already persisted.static voidpersist(Iterable<?> entities)Persist all given entities.static voidpersist(Object firstEntity, Object... entities)Persist all given entities.static voidpersist(Stream<?> entities)Persist all given entities.voidpersistAndFlush()Persist this entity in the database, if not already persisted.
-
-
-
Method Detail
-
persist
public void persist()
Persist this entity in the database, if not already persisted. This will set your ID field if it is not already set.
-
persistAndFlush
public void 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
public void delete()
Delete this entity from the database, if it is already persisted.
-
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.
-
persist
@GenerateBridge(callSuperMethod=true) public static void persist(Iterable<?> entities)
Persist all given entities.- Parameters:
entities- the entities to persist- See Also:
persist(),persist(Stream),persist(Object,Object...)
-
persist
@GenerateBridge(callSuperMethod=true) public static void persist(Stream<?> entities)
Persist all given entities.- Parameters:
entities- the entities to persist- See Also:
persist(),persist(Iterable),persist(Object,Object...)
-
persist
@GenerateBridge(callSuperMethod=true) public static void persist(Object firstEntity, Object... entities)
Persist all given entities.- Parameters:
entities- the entities to persist- See Also:
persist(),persist(Stream),persist(Iterable)
-
-