Model Class

Base class for persistence models generated by the javaxt-orm library.

Constructors

protected Model( String tableName )

Methods

delete( ) returns void
Used to delete a object from the database.
getID( ) returns Long
init( Class c, javaxt.sql.ConnectionPool connectionPool ) returns void
Used to associate a model with a connection pool.
        for (Jar.Entry entry : jar.getEntries()){
            String name = entry.getName();
            if (name.endsWith(".class")){
                name = name.substring(0, name.length()-6).replace("/", ".");
                Class c = Class.forName(name);
                if (javaxt.utils.Model.class.isAssignableFrom(c)){
                    javaxt.utils.Model.init(c, database.getConnectionPool());
                }
            }
        }
    
setID( Long id ) returns void
toJson( ) returns javaxt.json.JSONObject
Returns a JSON representation of the object.