no-argument constructor
A constructor that takes no parameters, which JPA requires on every entity so it can create the object before filling in its fields.
In more detail
It may be protected to discourage application code from creating half-built entities. Records cannot be JPA entities partly because they have no such constructor.
Example
protected OrderEntity() { }Related terms
- JPA entity — A class marked @Entity whose instances JPA stores as rows in a table, identified by a field marked @Id.
- constructor — The special method that runs when a new object is created from a class and sets up its starting data.
Taught in
- Persistence With JPA And Hibernate — Modern Java: Virtual Threads & High-Throughput Services
- Classes, Records And Initialisation Order — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Modules: Exports, Opens And Services — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Serialization: What Survives The Trip — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Mock Exam: Sit It, Score It — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep