Package mocka.generator.orm.hibernate
Class HibernateFieldValueGenerator
java.lang.Object
mocka.generator.orm.hibernate.HibernateFieldValueGenerator
- All Implemented Interfaces:
FieldValueGenerator
Generates random values for Hibernate entity fields based on their types and JPA annotations.
This generator analyzes field metadata (type, annotations, constraints) and produces appropriate random values for entity instantiation. It supports various data types including primitives, dates, enums, embeddables, and respects JPA validation constraints.
-
Method Summary
-
Method Details
-
get
Generates a random value for the given field based on its type and annotations.- Specified by:
getin interfaceFieldValueGenerator- Parameters:
field- the field to generate a value for- Returns:
- a randomly generated value appropriate for the field type, or null if the field should not be generated
- Throws:
RuntimeException- if@Emailis used on a non-String fieldUnsupportedOperationException- if the field type is not supported
-