Package com.d3x.core.db
Class Database.BasicMapping<T>
- java.lang.Object
-
- com.d3x.core.db.Database.BasicMapping<T>
-
- Type Parameters:
T- the data type for mapping
- All Implemented Interfaces:
DatabaseMapping<T>
- Enclosing class:
- Database
private static class Database.BasicMapping<T> extends java.lang.Object implements DatabaseMapping<T>
A generic mapping class for single type
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.d3x.core.db.DatabaseMapping
DatabaseMapping.Binder<T>, DatabaseMapping.Mapper<T>
-
-
Field Summary
Fields Modifier and Type Field Description private intsqlType
-
Constructor Summary
Constructors Constructor Description BasicMapping(int sqlType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private DatabaseMapping.Binder<T>binder()Returns a newly created binder appropriate for typeDatabaseMapping.Binder<T>delete()The binder to bind arguments to a PreparedStatement for affecting deletesDatabaseMapping.Binder<T>insert()The binder to bind arguments to a PreparedStatement for affecting insertsDatabaseMapping.Mapper<T>select()The mapper to map a row in a result set to some objectjava.lang.reflect.Typetype()Returns the data type for this mapping-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.d3x.core.db.DatabaseMapping
toIterator, toList, toSet, update
-
-
-
-
Method Detail
-
type
public java.lang.reflect.Type type()
Description copied from interface:DatabaseMappingReturns the data type for this mapping- Specified by:
typein interfaceDatabaseMapping<T>- Returns:
- the data type
-
select
public DatabaseMapping.Mapper<T> select()
Description copied from interface:DatabaseMappingThe mapper to map a row in a result set to some object- Specified by:
selectin interfaceDatabaseMapping<T>- Returns:
- the mapper to map a row in a result set to some object
-
insert
public DatabaseMapping.Binder<T> insert()
Description copied from interface:DatabaseMappingThe binder to bind arguments to a PreparedStatement for affecting inserts- Specified by:
insertin interfaceDatabaseMapping<T>- Returns:
- binder to bind arguments to a PreparedStatement for affecting inserts
-
delete
public DatabaseMapping.Binder<T> delete()
Description copied from interface:DatabaseMappingThe binder to bind arguments to a PreparedStatement for affecting deletes- Specified by:
deletein interfaceDatabaseMapping<T>- Returns:
- binder to bind arguments to a PreparedStatement for affecting deletes
-
binder
private DatabaseMapping.Binder<T> binder()
Returns a newly created binder appropriate for type- Returns:
- the newly created binder
-
-