Java / Quarkus Interview questions
What are the types of Panache entity patterns available?
Panache supports two different styles for structuring data access, and picking between them is mostly a matter of team preference rather than one being strictly more capable than the other.
| Active Record | Repository |
| Entity extends PanacheEntity; methods called directly on the entity class/instance. | Entity is a plain class; a separate Repository implements PanacheRepository<Entity>. |
| e.g. Person.findAll(), person.persist(). | e.g. personRepository.findAll(), personRepository.persist(person). |
| Less boilerplate, more concise for simple domains. | Better separation of concerns, easier to unit test with mocks. |
| Data-access logic lives on the entity itself. | Data-access logic lives in an injectable repository bean. |
Both patterns compile down to the same underlying Hibernate/Panache query mechanics, so switching between them is a structural, code-organization choice rather than a change in what queries are actually possible.
More Related questions...