}
}
public static void test(Connection connection) throws Exception
{
Transaction txn = new Transaction();
UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();
if (connection != null)
{
try
{
OverviewDoc overviewDoc = new OverviewDoc();
overviewDoc.setOverviewURL(
"http://www.steveviens.com/overviewdoc.html");
String tModelKey = uuidgen.uuidgen();
TModel tModel = new TModel();
tModel.setTModelKey(tModelKey);
tModel.setAuthorizedName("sviens");
tModel.setOperator("WebServiceRegistry.com");
tModel.setName("Tuscany Web Service Company");
tModel.setOverviewDoc(overviewDoc);
Vector keyRefs = new Vector();
keyRefs.add(new KeyedReference(uuidgen.uuidgen(), "blah, blah, blah"));
keyRefs.add(
new KeyedReference(uuidgen.uuidgen(), "Yadda, Yadda, Yadda"));
keyRefs.add(
new KeyedReference(uuidgen.uuidgen(), "WhoobWhoobWhoobWhoob"));
keyRefs.add(new KeyedReference(uuidgen.uuidgen(), "Haachachachacha"));
String authorizedUserID = "sviens";
// begin a new transaction
txn.begin(connection);
// insert a new TModel
TModelTable.insert(tModel, authorizedUserID, connection);
// insert a Collection of new Identifier KeyedReference objects
TModelIdentifierTable.insert(tModelKey, keyRefs, connection);
// insert another new TModel
tModel.setTModelKey(uuidgen.uuidgen());
TModelTable.insert(tModel, authorizedUserID, connection);
// insert another Collection of new Identifier KeyedReference objects
TModelIdentifierTable.insert(
tModel.getTModelKey(),
keyRefs,
connection);
// select a Collection of Identifier KeyedReference objects
keyRefs = TModelIdentifierTable.select(tModelKey, connection);
// delete a Collection of Identifier KeyedReference objects
TModelIdentifierTable.delete(tModelKey, connection);
// re-select a Collection of Identifier KeyedReference objects
keyRefs = TModelIdentifierTable.select(tModelKey, connection);
// commit the transaction
txn.commit();
}
catch (Exception ex)
{
try
{
txn.rollback();
}
catch (java.sql.SQLException sqlex)
{
sqlex.printStackTrace();
}