Class EntityPersistent
java.lang.Object
io.github.blyznytsiaorg.bibernate.entity.EntityPersistent
Provides functionality for mapping data from a ResultSet to an entity object.
This class facilitates the process of converting database query results into
corresponding entity objects.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addIgnoredRelationFields
(List<String> fieldNames) Adds the specified field names to the list of ignored relation fields.void
Clears the list of ignored relation fields.private <T> void
setFieldDependency
(TypeFieldResolver valueType, Field field, T entity, ResultSet resultSet) <T> T
Converts data from a ResultSet into an entity object of the specified class.
-
Field Details
-
typeResolverFactory
-
ignoredRelationFields
-
-
Constructor Details
-
EntityPersistent
public EntityPersistent()
-
-
Method Details
-
toEntity
public <T> T toEntity(ResultSet resultSet, Class<T> entityClass) throws ReflectiveOperationException Converts data from a ResultSet into an entity object of the specified class.- Type Parameters:
T
- The type of the entity.- Parameters:
resultSet
- The ResultSet containing the data to be mapped.entityClass
- The class of the entity to be instantiated.- Returns:
- An instance of the entity class populated with data from the ResultSet.
- Throws:
ReflectiveOperationException
- If an error occurs during reflection-based operations.
-
setFieldDependency
private <T> void setFieldDependency(TypeFieldResolver valueType, Field field, T entity, ResultSet resultSet) -
addIgnoredRelationFields
Adds the specified field names to the list of ignored relation fields.- Parameters:
fieldNames
- The names of the fields to be ignored.
-
clearIgnoredRelationFields
public void clearIgnoredRelationFields()Clears the list of ignored relation fields.
-