public List<Class<?>> getClasses() throws SQLException
{
ArrayList<Class<?>> res = new ArrayList<Class<?>>();
// get all c__IS_A entries
String selectStmt = "SELECT * from " + Defaults.IS_A_TABLENAME;
ConnectionWrapper cw = getConnectionWrapper();
try
{
PreparedStatement ps = cw.prepareStatement(selectStmt);
ResultSet rs = ps.executeQuery();
while (rs.next())
{
String superClassName = rs.getString("SUPERCLASS");
String subClassName = rs.getString("SUBCLASS");
try
{
Class<?> superClass = ObjectTools
.lookUpClass(superClassName);
if (superClass != null && !res.contains(superClass))
{
res.add(superClass);
}
}
catch (ClassNotFoundException e)
{
LOGGER.log(Level.WARNING, "ClassNotFoundException: ", e);
}
try
{
Class<?> subClass = ObjectTools.lookUpClass(subClassName);
if (subClass != null && !res.contains(subClass))
{
res.add(subClass);
}
}
catch (ClassNotFoundException e)
{
LOGGER.log(Level.WARNING, "ClassNotFoundException: ", e);
}
}
ps.close();
cw.commitAndDiscard();
}
catch (Exception e)
{
cw.rollbackAndDiscard();
throw new SQLException(e);
}
return res;
}