org.jminor.framework.tools.generator
Class EntityGeneratorModel

java.lang.Object
  extended by org.jminor.framework.tools.generator.EntityGeneratorModel

public final class EntityGeneratorModel
extends Object

A model class for generating entity definitions.

See Also:
EntityGeneratorPanel

Nested Class Summary
static class EntityGeneratorModel.Table
           
 
Constructor Summary
EntityGeneratorModel(Database database, User user, String schema)
          Instantiates a new EntityGeneratorModel.
EntityGeneratorModel(User user, String schema)
          Instantiates a new EntityGeneratorModel.
 
Method Summary
 void addRefreshEndedListener(ActionListener listener)
           
 void addRefreshStartedListener(ActionListener listener)
           
 void exit()
          Closes the connection to the database
 Document getDocument()
           
 String getDocumentText()
           
 AbstractFilteredTableModel<EntityGeneratorModel.Table,Integer> getTableModel()
           
 void removeRefreshEndedListener(ActionListener listener)
           
 void removeRefreshStartedListener(ActionListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityGeneratorModel

public EntityGeneratorModel(User user,
                            String schema)
                     throws ClassNotFoundException,
                            SQLException
Instantiates a new EntityGeneratorModel.

Parameters:
user - the user
schema - the schema name
Throws:
ClassNotFoundException - in case the JDBC driver class was not found on the classpath
SQLException - in case of an exception while connecting to the database

EntityGeneratorModel

public EntityGeneratorModel(Database database,
                            User user,
                            String schema)
                     throws ClassNotFoundException,
                            SQLException
Instantiates a new EntityGeneratorModel.

Parameters:
database - the database
user - the user
schema - the schema name
Throws:
ClassNotFoundException - in case the JDBC driver class was not found on the classpath
SQLException - in case of an exception while connecting to the database
Method Detail

getTableModel

public AbstractFilteredTableModel<EntityGeneratorModel.Table,Integer> getTableModel()
Returns:
a table model containing the tables from the generator schema

getDocument

public Document getDocument()
Returns:
the text document containing the entity definitions of the selected tables

getDocumentText

public String getDocumentText()
Returns:
the text from the entity definition document

addRefreshStartedListener

public void addRefreshStartedListener(ActionListener listener)
Parameters:
listener - a listener notified each time a refresh has started

removeRefreshStartedListener

public void removeRefreshStartedListener(ActionListener listener)
Parameters:
listener - the listener to remove

addRefreshEndedListener

public void addRefreshEndedListener(ActionListener listener)
Parameters:
listener - a listener notified each time a refresh has ended

removeRefreshEndedListener

public void removeRefreshEndedListener(ActionListener listener)
Parameters:
listener - the listener to remove

exit

public void exit()
Closes the connection to the database