springpython.database.core
index
/home/gturnquist/spring-python-1.2.x/src/springpython/database/core.py

Copyright 2006-2008 SpringSource (http://springsource.com), All Rights Reserved
 
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
 
    http://www.apache.org/licenses/LICENSE-2.0
 
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

 
Modules
       
springpython.database.factory
logging
types

 
Classes
       
__builtin__.object
DaoSupport
DatabaseTemplate
RowMapper
DictionaryRowMapper
SimpleRowMapper

 
class DaoSupport(__builtin__.object)
    Any class that extends this one will be provided with a DatabaseTemplate class
to help carry out database operations. It requires that a connection object be
provided during instantion.
 
  Methods defined here:
__init__(self, connection_factory=None)
__setattr__(self, name, value)
When the connection factory is set, pass it on through to the database template.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class DatabaseTemplate(__builtin__.object)
    This class is meant to mimic the Spring framework's JdbcTemplate class.
Since Python doesn't use JDBC, the name is generalized to "Database"
 
  Methods defined here:
__del__(self)
When this template goes out of scope, need to close the connection it formed.
__init__(self, connection_factory=None)
execute(self, sql_statement, args=None)
Execute a single SQL statement, and return the number of rows affected.
insert_and_return_id(self, sql_statement, args=None)
Execute a single INSERT statement, and return the PK of the new row.
query(self, sql_query, args=None, rowhandler=None)
Execute a query given static SQL, reading the ResultSet on a per-row basis with a RowMapper.
If args is provided, bind the arguments (to avoid SQL injection attacks).
query_for_int(self, sql_query, args=None)
Execute a query that results in an int value, given static SQL. If args is provided, bind the arguments 
(to avoid SQL injection attacks).
query_for_list(self, sql_query, args=None)
query_for_long(self, sql_query, args=None)
Execute a query that results in an int value, given static SQL. If args is provided, bind the arguments 
(to avoid SQL injection attacks).
query_for_object(self, sql_query, args=None, required_type=None)
Execute a query that results in an int value, given static SQL. If args is provided, bind the arguments 
(to avoid SQL injection attacks).
update(self, sql_statement, args=None)
Issue a single SQL update.  If args is provided, bind the arguments 
(to avoid SQL injection attacks).

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class DictionaryRowMapper(RowMapper)
    This row mapper converts the tuple into a dictionary using the column names as the keys.
 
 
Method resolution order:
DictionaryRowMapper
RowMapper
__builtin__.object

Methods defined here:
map_row(self, row, metadata=None)

Data descriptors inherited from RowMapper:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class RowMapper(__builtin__.object)
    This is an interface to handle one row of data.
 
  Methods defined here:
map_row(self, row, metadata=None)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class SimpleRowMapper(RowMapper)
    This row mapper uses convention over configuration to create and populate attributes
of an object.
 
 
Method resolution order:
SimpleRowMapper
RowMapper
__builtin__.object

Methods defined here:
__init__(self, clazz)
map_row(self, row, metadata=None)

Data descriptors inherited from RowMapper:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)