public abstract class AbstractJDBCResourceProvider<E extends Enum<E>> extends AbstractResourceProvider
AbstractResourceProvider.Command<T>
LOG
Modifier | Constructor and Description |
---|---|
protected |
AbstractJDBCResourceProvider(Set<String> propertyIds,
Map<Resource.Type,String> keyPropertyIds)
Create a new resource provider.
|
Modifier and Type | Method and Description |
---|---|
protected E |
getDBField(String propertyId)
Gets a db field corresponding to a property id.
|
protected abstract Map<String,E> |
getDBFieldMap()
Gets a map from property ids to db fields.
|
protected String |
getDBFieldString(Set<String> requestedIds)
Gets a comma-separated list of db fields corresponding to set of requested
ids.
|
protected void |
setInt(Resource resource,
String propertyId,
ResultSet rs,
Set<String> requestedIds)
Retrieves the db field corresponding to a property id from a result set as
an int and sets the resulting int as a resource property.
|
protected void |
setLong(Resource resource,
String propertyId,
ResultSet rs,
Set<String> requestedIds)
Retrieves the db field corresponding to a property id from a result set as
a long and sets the resulting long as a resource property.
|
protected void |
setString(Resource resource,
String propertyId,
ResultSet rs,
Set<String> requestedIds)
Retrieves the db field corresponding to a property id from a result set as
a string and sets the resulting string as a resource property.
|
addObserver, createResources, getConfigurationRequest, getKeyPropertyIds, getPKPropertyIds, getPropertyMaps, getPropertyMaps, getRequestStatus, getRequestStatus, getResources, modifyResources, notifyCreate, notifyDelete, notifyUpdate, updateObservers
checkConfigPropertyIds, checkPropertyIds, containsArguments, getPropertyIds, getRegexGroups, getRegExpKey, getRequestPropertyIds, isPatternKey, setResourceProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkPropertyIds, createResources, deleteResources, getResources, updateResources
protected AbstractJDBCResourceProvider(Set<String> propertyIds, Map<Resource.Type,String> keyPropertyIds)
propertyIds
- the property idskeyPropertyIds
- the key property idsprotected abstract Map<String,E> getDBFieldMap()
protected void setString(Resource resource, String propertyId, ResultSet rs, Set<String> requestedIds) throws SQLException
resource
- resource object to set the property onpropertyId
- the property id to retrieve from the result setrs
- the result setrequestedIds
- the requested idsSQLException
- if property id cannot be retrieved from the result setprotected void setInt(Resource resource, String propertyId, ResultSet rs, Set<String> requestedIds) throws SQLException
resource
- resource object to set the property onpropertyId
- the property id to retrieve from the result setrs
- the result setrequestedIds
- the requested idsSQLException
- if property id cannot be retrieved from the result setprotected void setLong(Resource resource, String propertyId, ResultSet rs, Set<String> requestedIds) throws SQLException
resource
- resource object to set the property onpropertyId
- the property id to retrieve from the result setrs
- the result setrequestedIds
- the requested idsSQLException
- if property id cannot be retrieved from the result setprotected String getDBFieldString(Set<String> requestedIds)
requestedIds
- the requested idsCopyright © 2015. All rights reserved.