Index

A C D E F G I J M N O P R S T U V 
All Classes and Interfaces|All Packages|Serialized Form

A

add(Class<?>, String) - Method in class io.github.simplejdbcmapper.core.MultiEntity
Add entities for multi-entity processing.
addEntityResult(Class<T>, List<T>, String) - Method in class io.github.simplejdbcmapper.relationship.RelationshipMapper
Add an entity result
AnnotationException - Exception Class in io.github.simplejdbcmapper.exception
Annotation Exception.
AnnotationException(String) - Constructor for exception class io.github.simplejdbcmapper.exception.AnnotationException
 
assemble(Relationship...) - Method in class io.github.simplejdbcmapper.relationship.RelationshipMapper
Assembles the relationships from the query results.
AUTO_GENERATED - Enum constant in enum class io.github.simplejdbcmapper.annotation.IdType
 

C

catalog() - Element in annotation interface io.github.simplejdbcmapper.annotation.Table
 
close() - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Closes down SimpleJdbcMapper.
Column - Annotation Interface in io.github.simplejdbcmapper.annotation
Properties that need be persisted to the database will need this annotation unless the property is already annotated with one of the other annotations.
CreatedBy - Annotation Interface in io.github.simplejdbcmapper.annotation
If a Supplier is configured with SimpleJdbcMapper, the property annotated will be set to the value supplied when the record is created.
CreatedOn - Annotation Interface in io.github.simplejdbcmapper.annotation
If a Supplier is configured with SimpleJdbcMapper, the property annotated will be set to the value supplied when the record is created.

D

delete(Object) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Deletes the object from the database.
deleteById(Class<?>, Object) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Deletes the object from the database by id.

E

entityRowMapper(Class<T>) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Returns a new EntityRowMapper.
EntityRowMapper<T> - Class in io.github.simplejdbcmapper.core
A row mapper for mapped objects.

F

findAll(Class<T>, SortBy...) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Find all objects.
findById(Class<T>, Object) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
finds the object by Id.
findByPropertyValue(Class<T>, String, Object, SortBy...) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Returns list of objects which match the property value.
findByPropertyValues(Class<T>, String, Collection<U>, SortBy...) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Returns list of objects which match the collection of property values.

G

getBeanFriendlySqlColumns(Class<?>) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Gets the sql columns.
getBeanFriendlySqlColumns(Class<?>, String) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Gets the sql columns with columns prefixed with the table alias.
getCatalogName() - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Get the catalog name.
getConversionService() - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Exposing the conversion service used, so if necessary new converters can be added etc.
getDirection() - Method in class io.github.simplejdbcmapper.core.SortBy
 
getEntitySqlColumns(Class<?>) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Deprecated, for removal: This API element is subject to removal in a future version.
Use getSqlColumns(Class<?> entityType) instead.

Gets the sql columns that works with EntityRowMapper. EntityRowMapper expects the sql columns to be in a specific order since it uses position indexes to retrieve the data from the query ResultSet. Do not modify the generated sql columns.

Always use this method (or its overloaded method getEntitySqlColumns(Class<?> entityType, String tableAlias)) to create your custom query columns when using EntityRowMapper. EntityRowMapper will handle the column to property mapping.

             "somecolumn, some_other_column, last_name"
             
See newEntityRowMapper(java.lang.Class<T>)
getEntitySqlColumns(Class<?>, String) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Deprecated, for removal: This API element is subject to removal in a future version.
Use getSqlColumns(Class<?> entityType, String tableAlias) instead.

Gets the sql columns with table aliases that works with EntityRowMapper. EntityRowMapper expects the sql columns to be in a specific order since it uses position indexes to retrieve the data from the query ResultSet. Do not modify the generated sql columns.

Always use this method (or its overloaded method getEntitySqlColumns(Class<?> entityType)) to create your custom query columns when using EntityRowMapper. create your custom query columns when using EntityRowMapper. EntityRowMapper will handle the column to property mapping.

Use it in your custom queries when you are doing joins and need columns corresponding to a table alias.

For tableAlias argument 't1' will return something like below:

             "t1.somecolumn, t1.someothercolumn, t1.last_name"
             
Its good practice to keep the table aliases short and succinct. See newEntityRowMapper(java.lang.Class<T>)
getIdPropertyName(Class<?>) - Method in class io.github.simplejdbcmapper.relationship.RelationshipMapper
Get the Id property name for type.
getJdbcClient() - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Gets the JdbcClient of the SimpleJdbcMapper.
getJdbcTemplate() - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Gets the JdbcTemplate of the SimpleJdbcMapper.
getList(Class<E>) - Method in interface io.github.simplejdbcmapper.relationship.GetListSpec
Gets list by type for the relationship
getList(Class<T>) - Method in class io.github.simplejdbcmapper.relationship.RelationshipMapper
returns the results for the type
GetListSpec - Interface in io.github.simplejdbcmapper.relationship
Get list by type interface.
getMultiEntitySqlColumns(MultiEntity) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Deprecated, for removal: This API element is subject to removal in a future version.
Use getSqlColumns(MultiEntity multiEntity) instead.
Gets the sql columns for multi-entity processing. These sql columns are used with the ResultSetExtractor and should not be modified since the extractor uses position indexes to retrieve the data from the query ResultSet.

For the following multi-entity:

             new MultiEntity().add(Order.class, "o").add(OrderLine.class, "ol")
             
this will generate sql columns like below:
 o.id, o.order_date, ol.id, ol.product_id ...
             
Its good practice to keep the table aliases short and succinct. See resultSetExtractor(io.github.simplejdbcmapper.core.MultiEntity)
getNamedParameterJdbcTemplate() - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Gets the NamedParameterJdbcTemplate of the SimpleJdbcMapper.
getPropertyName() - Method in class io.github.simplejdbcmapper.core.SortBy
 
getPropertyToColumnMappings(Class<?>) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
returns a map with all the properties of the mapped class and their corresponding column names
getSchemaName() - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Get the schema name.
getSqlColumns(MultiEntity) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Gets the sql columns for multi-entity processing.
getSqlColumns(Class<?>) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Gets the sql columns that works with EntityRowMapper.
getSqlColumns(Class<?>, String) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Gets the sql columns with table aliases that works with EntityRowMapper.

I

Id - Annotation Interface in io.github.simplejdbcmapper.annotation
Annotation for Identifier.
IdType - Enum Class in io.github.simplejdbcmapper.annotation
The type of the @id annotation.
insert(Object) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Inserts an object.
io.github.simplejdbcmapper.annotation - package io.github.simplejdbcmapper.annotation
 
io.github.simplejdbcmapper.core - package io.github.simplejdbcmapper.core
 
io.github.simplejdbcmapper.exception - package io.github.simplejdbcmapper.exception
 
io.github.simplejdbcmapper.relationship - package io.github.simplejdbcmapper.relationship
 

J

joinOn(String, String) - Method in interface io.github.simplejdbcmapper.relationship.RelationshipFluent.ToMany
The properties on each list whose values should be matched to populate the toMany relationship.
joinOn(String, String) - Method in interface io.github.simplejdbcmapper.relationship.RelationshipFluent.ToOne
The properties on the two lists whose values should be matched to populate the toOne relationship.

M

MANUAL - Enum constant in enum class io.github.simplejdbcmapper.annotation.IdType
 
MapperException - Exception Class in io.github.simplejdbcmapper.exception
Generic Mapper Exception.
MapperException(Exception) - Constructor for exception class io.github.simplejdbcmapper.exception.MapperException
 
MapperException(String) - Constructor for exception class io.github.simplejdbcmapper.exception.MapperException
 
MapperException(String, Exception) - Constructor for exception class io.github.simplejdbcmapper.exception.MapperException
 
mapRow(ResultSet, int) - Method in class io.github.simplejdbcmapper.core.EntityRowMapper
 
MultiEntity - Class in io.github.simplejdbcmapper.core
Used in multi-entity processing.
MultiEntity() - Constructor for class io.github.simplejdbcmapper.core.MultiEntity
 

N

name() - Element in annotation interface io.github.simplejdbcmapper.annotation.Column
column name
name() - Element in annotation interface io.github.simplejdbcmapper.annotation.Table
 
newEntityRowMapper(Class<T>) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Deprecated, for removal: This API element is subject to removal in a future version.
Use entityRowMapper(Class) instead.

Returns a new EntityRowMapper.

EntityRowMapper always has to be used with sql columns generated by either

 getEntitySqlColumns(Class<?> entityType) or
 getEntitySqlColumns(Class<?> entityType, String tableAlias)
 

It expects the sql columns to be in a specific order because it uses position indexes to retrieve the data from the query ResultSet. It will handle the cases where the column to property mappings do not follow the underscore to camel case naming convention.

This is the recommended row mapper to use when writing custom queries for mapped objects. It has optimizations which allows it to process data from the query ResultSet in a performant way.

Query:

             String sql = "SELECT " + sjm.getEntitySqlColumns(Product.class) + "FROM product WHERE name = ?";
             
Example using JdbcTemplate:
 List<Product> products = sjm.getJdbcTemplate().query(sql,sjm.newEntityRowMapper(Product.class), "someProductName");
 

Example using JdbcClient. Note that the EntityRowMaper has to be passed in as an argument, otherwise JdbcClient will use its internal row mapper SimplePropertyRowMapper which will not work with the sql.

 List<Product> products = sjm.getJdbcClient().sql(sql)
                                                     .param("someProductName")
                                                     .query(sjm.newEntityRowMapper(Product.class))
                                                     .list();
 

O

OptimisticLockingException - Exception Class in io.github.simplejdbcmapper.exception
updates with stale data will throw this exception when model property is annotated with @Version.
OptimisticLockingException(String) - Constructor for exception class io.github.simplejdbcmapper.exception.OptimisticLockingException
 

P

populate(String) - Method in interface io.github.simplejdbcmapper.relationship.RelationshipFluent.Populate
The property to populate on the main object.

R

Relationship - Class in io.github.simplejdbcmapper.relationship
The relationship definition.
RelationshipFluent - Interface in io.github.simplejdbcmapper.relationship
The relationship fluent api interface.
RelationshipFluent.Populate - Interface in io.github.simplejdbcmapper.relationship
The populate interface.
RelationshipFluent.RelationshipType - Interface in io.github.simplejdbcmapper.relationship
The relationship type interface.
RelationshipFluent.ToMany - Interface in io.github.simplejdbcmapper.relationship
The toMany interface.
RelationshipFluent.ToOne - Interface in io.github.simplejdbcmapper.relationship
The toOne interface.
RelationshipMapper - Class in io.github.simplejdbcmapper.relationship
This holds the results from a multi-entity query.
RelationshipMapper() - Constructor for class io.github.simplejdbcmapper.relationship.RelationshipMapper
 
resultSetExtractor(MultiEntity) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
The ResultSetExtractor for multiple entities.

S

schema() - Element in annotation interface io.github.simplejdbcmapper.annotation.Table
 
setConversionService(ConversionService) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Set the conversion service
setRecordAuditedBySupplier(Supplier<T>) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Set the Supplier that is used to populate the @CreatedBy and @UpdatedBy annotated properties.
setRecordAuditedOnSupplier(Supplier<T>) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Set the Supplier that is used to populate the @CreatedOn and @UpdatedOn annotated properties.
SimpleJdbcMapper - Class in io.github.simplejdbcmapper.core
CRUD methods and configuration for SimpleJdbcMapper.
SimpleJdbcMapper(DataSource) - Constructor for class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Constructor.
SimpleJdbcMapper(DataSource, String) - Constructor for class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Constructor.
SimpleJdbcMapper(DataSource, String, String) - Constructor for class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Constructor.
SortBy - Class in io.github.simplejdbcmapper.core
This is used to generate the "ORDER BY" clause for the queries.
SortBy(String) - Constructor for class io.github.simplejdbcmapper.core.SortBy
The constructor
SortBy(String, String) - Constructor for class io.github.simplejdbcmapper.core.SortBy
The constructor
sqlType() - Element in annotation interface io.github.simplejdbcmapper.annotation.Column
column sqlType

T

Table - Annotation Interface in io.github.simplejdbcmapper.annotation
Annotation to map an object to a database/view table.
through(Class<?>, String, String) - Method in interface io.github.simplejdbcmapper.relationship.RelationshipFluent.ToMany
The 'through' information when defining a toMany relationship through an intermediate table (one side of many to many).
toMany(Class<?>) - Method in interface io.github.simplejdbcmapper.relationship.RelationshipFluent.RelationshipType
A toMany relationship.
toOne(Class<?>) - Method in interface io.github.simplejdbcmapper.relationship.RelationshipFluent.RelationshipType
A toOne relationship.
toString() - Method in class io.github.simplejdbcmapper.core.EntityRowMapper
 
toString() - Method in class io.github.simplejdbcmapper.relationship.Relationship
 
type() - Element in annotation interface io.github.simplejdbcmapper.annotation.Id
 
type(Class<?>) - Static method in class io.github.simplejdbcmapper.relationship.Relationship
Starts the relationship fluent flow.

U

update(Object) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Update the object.
UpdatedBy - Annotation Interface in io.github.simplejdbcmapper.annotation
If a Supplier is configured with SimpleJdbcMapper, the annotated property value will be set to the value supplied when the record is updated.
UpdatedOn - Annotation Interface in io.github.simplejdbcmapper.annotation
If a Supplier is configured with SimpleJdbcMapper, the annotated property value will be set to the value supplied when the record is updated.
updateSpecificProperties(Object, String...) - Method in class io.github.simplejdbcmapper.core.SimpleJdbcMapper
Updates only the specified properties passed in as arguments.

V

valueOf(String) - Static method in enum class io.github.simplejdbcmapper.annotation.IdType
Returns the enum constant of this class with the specified name.
values() - Static method in enum class io.github.simplejdbcmapper.annotation.IdType
Returns an array containing the constants of this enum class, in the order they are declared.
Version - Annotation Interface in io.github.simplejdbcmapper.annotation
This annotation is used for optimistic locking.
A C D E F G I J M N O P R S T U V 
All Classes and Interfaces|All Packages|Serialized Form