public interface ORMConverter
Interface for converting ORM parameters to SQL parameters.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceInterface for resolving names of record components. -
Method Summary
Modifier and TypeMethodDescriptionfromDatabase(Object[] values) Converts the given values to an object that is used in the object model.getColumns(ORMConverter.NameResolver nameResolver) Returns the names of the columns that will be used in the SQL template.default intReturns the number of parameters in the SQL template.Returns the types of the parameters in the SQL template.toDatabase(Record record) Converts the given record to a list of values that can be used in the SQL template.
-
Method Details
-
getParameterCount
Returns the number of parameters in the SQL template.Note: the count must match the parameter as returned by
getParameterTypes().- Returns:
- the number of parameters.
- Throws:
SqlTemplateException
-
getParameterTypes
Returns the types of the parameters in the SQL template.- Returns:
- a list of parameter types.
- Throws:
SqlTemplateException
-
getColumns
Returns the names of the columns that will be used in the SQL template.Note: the names must match the parameters as returned by
getParameterTypes().- Returns:
- a list of column names.
- Throws:
SqlTemplateException
-
toDatabase
Converts the given record to a list of values that can be used in the SQL template.Note: the values must match the parameters as returned by
getParameterTypes().- Parameters:
record- the record to convert.- Returns:
- the values to be used in the SQL template.
- Throws:
SqlTemplateException
-
fromDatabase
Converts the given values to an object that is used in the object model.- Parameters:
values- the arguments to convert. The arguments match the parameter types as returned by getParameterTypes().- Returns:
- the converted object.
- Throws:
SqlTemplateException- if an error occurs during conversion.
-