Interface | Description |
---|---|
PanacheQuery<Entity> | |
PanacheRepository<Entity> |
Represents a Repository for a specific type of entity
Entity , with an ID type
of Long . |
PanacheRepositoryBase<Entity,Id> |
Represents a Repository for a specific type of entity
Entity , with an ID type
of Id . |
Class | Description |
---|---|
Panache |
Utility class for Panache.
|
PanacheEntity |
Represents an entity with a generated ID field
PanacheEntity.id of type Long . |
PanacheEntityBase |
Represents an entity.
|
PanacheEntity
, use public fields for your columns, use the
existing
operations defined as static methods on your entity class, and define custom ones as static methods on your entity class:
@Entity
public class Person extends PanacheEntity {
public String name;
public LocalDate birth;
public PersonStatus status;
public static Person findByName(String name){
return find("name", name).firstResult();
}
public static List<Person> findAlive(){
return list("status", Status.Alive);
}
public static void deleteStefs(){
delete("name", "Stef");
}
}
Normally, HQL queries are of this form: from EntityName [where ...] [order by ...]
, with optional elements
at the end.
If your query does not start with from
, we support the following additional forms:
order by ...
which will expand to from EntityName order by ...
<singleColumnName>
(and single parameter) which will expand to
from EntityName where <singleColumnName> = ?
<query>
will expand to from EntityName where <query>
Copyright © 2019 JBoss by Red Hat. All rights reserved.