Package edu.uiuc.ncsa.security.storage.sql
Classes that setup a specific type of correspondence between java objects and rows of an SQL table.
What does this all do?
One of the most commonly used constructs in Java is a map which associates keys and values (which are java objects). This is very simply modelled in SQL by having each row of a database correspond to the object and allows us to manage the data in tables as objects. This special case is pretty easy to manage and this package will do most all of the grunt work in setting up databases and object creation for you.How to implement your own example.
- Make your object implement the
Identifiable
interface. This gives a way to track objects by unique identifier. This identifier should be the primary key for your database. FYI: A standard uuid can be used as an identifer, just pass it as a string. - Make a class that extends
edu.uiuc.ncsa.security.storage.sql.Table
(or implementsedu.uiuc.ncsa.security.storage.sql.TableInterface
, which is a bit harder). Assuming you are extending Table, you need to implement one, single method callededu.uiuc.ncsa.security.storage.sql.TableInterface.createColumnDescriptors
. This tells the system what columns it should create and what types they have. - Extend
SQLStore
. This has a couple of methods called populate and depopulate. These methods tell how to take one of your objects and "populate" it, i.e., set the values. "depopulate" tells how to get the values. read the documentation there.
-
Interface Summary Interface Description ConnectionParameters Class that wraps the JDBC connection string for an SQL database. -
Class Summary Class Description AdminConnectionParameters Databases might require access as a specific administrator.ConnectionPool<T extends ConnectionRecord> A pool for jdbc connections.ConnectionPoolProvider<T extends ConnectionPool> Creates aConnectionPool
from a configuration.ConnectionRecord Created by Jeff Gaynor
on 5/11/21 at 10:25 AMDBInitializer A class that automates the creation of tables and indices for an SQL database.SQLConnectionImpl General connection parameters object for a relational database.SQLDatabase /** Top-level SQL object.SQLDBInitializer Created by Jeff Gaynor
on 4/23/12 at 11:12 AMSQLInitializerProvider Created by Jeff Gaynor
on 5/4/12 at 9:24 AMSQLStore<V extends Identifiable> Top-level SQL store object.SQLStoreProvider<T extends Store> For creating SQL-based storesStackMap<V extends Identifiable> This will block until the capacity drops below max.TableInitializer Created by Jeff Gaynor
on 5/3/12 at 3:21 PM