|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsemorg.sql.tables.AbstractTable
semorg.sql.tables.SeminarType
public class SeminarType
Field Summary | |
---|---|
protected String |
audience
The ausidence of a seminartype. |
protected Float |
charge
The charge of a seminartype. |
private static String |
conductQueryString
Parameterized SQL statement to get a seminartypes conducted by a given lecturer. |
private static String |
createTableSQLString
SQL statement for creating the table "seminartype" (if not exists). |
protected String |
documents
The documents of a seminartype. |
protected Integer |
duration
The duration of a seminartype. |
protected int |
id
The DB-ID. |
static List<Integer> |
lockedIds
|
protected Integer |
maxEntrants
The maximal number of entrants of a seminartype. |
protected String |
methodology
The methodology of a seminartype. |
protected Integer |
minEntrants
The minimal number of entrants of a seminartype. |
protected String |
objective
The objective of a seminartype. |
private static String |
queryString
SQL query to get all seminartype records from the database. |
protected String |
requirements
The requirements of a seminartype. |
protected String |
routine
The routine of a seminartype. |
protected static String |
seminarTypeInsertString
Parameterized SQL statement for inserting a data record. |
protected static String |
seminarTypeUpdateString
Parameterized SQL statement for updating a data record. |
protected String |
shortTitle
The shortened title of a seminartype. |
private static String |
tableName
The name of the corresponding table in the db. |
protected String |
title
The title of a seminartype. |
protected String |
topic
The topic of a seminartype. |
Fields inherited from class semorg.sql.tables.AbstractTable |
---|
creationDate, modificationDate, NULL_ID |
Constructor Summary | |
---|---|
SeminarType(int id,
String shortTitle,
String title,
String objective,
String methodology,
String topic,
String routine,
Integer duration,
String documents,
String audience,
String requirements,
Float charge,
Integer maxEntrants,
Integer minEntrants,
Timestamp creationDate,
Timestamp modificationDate)
Creates an instance of the class SeminarType with the given parameters. |
Method Summary | |
---|---|
static void |
createSeminarTypeTable(Statement statement)
Creates the table "seminartype" if it does not exist. |
boolean |
equals(Object otherSeminarType)
If the given object is an instance of the SeminarType class this
method compares the id of the given and the actual object, otherwise it
calls the equal-method of the AbstractTable class with the given object. |
boolean |
equals(SeminarType otherSeminarType)
Compares the ids of a given object and the current one. |
String |
getAudience()
|
Float |
getCharge()
|
static Vector<DBColumn> |
getColumns()
Returns a vector of DBColumn instances according to
the properties of the table corresponding to this class. |
String |
getDocuments()
|
Integer |
getDuration()
|
int |
getId()
Returns the DB-ID of a database records. |
Integer |
getMaxEntrants()
|
String |
getMethodology()
|
Integer |
getMinEntrants()
|
static SeminarType |
getNext(int semTypeId)
Returns for a DB-ID the SeminarType object according to the data
record which has the next bigger id. |
String |
getObjective()
|
static SeminarType |
getPrevious(int semTypeId)
Returns for a DB-ID the SeminarType instance according to the
record which has the next smaller id. |
String |
getRequirements()
|
String |
getRoutine()
|
static SeminarType |
getSeminarTypeFromDB(int semTypeId)
Returns for a given id the corresponding SeminarType object. |
static DistinctVector<SeminarType> |
getSemTypeConductedBy(int lecturerId)
Returns for a given lecturer id the seminartypes whose are conducted by the lecturer corresponding to the id. |
String |
getShortTitle()
|
String |
getTitle()
|
String |
getTopic()
|
private static DistinctVector<SeminarType> |
getVector(ResultSet resultSet)
Creates for each element in a given ResultSet instance an instance of this class and returns a vector with the resulting class objects. |
static DistinctVector<SeminarType> |
getVectorFromDB(Vector<DBConstraint> additionalConstraints,
String sortString)
Creates a PreparedStatement instance with the given parameters, executes the query and returns a vector of instances of this class corresponding to the ResultSet of the query. |
int |
hashCode()
Returns the id. |
int |
insertIntoDB()
Converts the actual Company object into a database record and inserts it into the table "seminartype". |
static void |
removeFromDB(Iterable selectedElements)
Removes the given elements from the corresponding DB table . |
void |
setAudience(String audience)
|
void |
setCharge(Float charge)
|
void |
setDocuments(String documents)
|
void |
setDuration(Integer duration)
|
void |
setMaxEntrants(Integer maxEntrants)
|
void |
setMethodology(String methodology)
|
void |
setMinEntrants(Integer minEntrants)
|
void |
setObjective(String objective)
|
void |
setRequirements(String requirements)
|
void |
setRoutine(String routine)
|
void |
setShortTitle(String shortTitle)
|
void |
setTitle(String title)
|
void |
setTopic(String topic)
|
static boolean |
tableOK()
Checks if the according DB table exists. |
void |
updateDB()
Converts the actual SeminarType object into a database record and
updates a existing record to the changes made. |
Methods inherited from class semorg.sql.tables.AbstractTable |
---|
addDBTableChangedListener, createExtendedQueryString, fireTableChangedEvent, getColumns, getCreationDate, getModificationDate, getNext, getPrevious, removeDBTableChangedListener, setModificationDate, tableOK |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static List<Integer> lockedIds
protected int id
protected String shortTitle
protected String title
protected String objective
protected String methodology
protected String topic
protected String routine
protected Integer duration
protected String documents
protected String audience
protected String requirements
protected Float charge
protected Integer maxEntrants
protected Integer minEntrants
private static String tableName
protected static String seminarTypeInsertString
private static String createTableSQLString
protected static String seminarTypeUpdateString
private static String queryString
private static String conductQueryString
Constructor Detail |
---|
public SeminarType(int id, String shortTitle, String title, String objective, String methodology, String topic, String routine, Integer duration, String documents, String audience, String requirements, Float charge, Integer maxEntrants, Integer minEntrants, Timestamp creationDate, Timestamp modificationDate)
Method Detail |
---|
public static boolean tableOK()
true
, if the table is ok, false
otherwise.AbstractTable.tableOK(String)
public static void createSeminarTypeTable(Statement statement) throws SQLException
statement
- instance of the class Statement, which is used for
executing the SQL statement createTableSQLString
.
SQLException
- If the execution of the given statement with the query
createTableSQLString
or its closing fails.public int insertIntoDB() throws SQLException
id
and returns
the id. Finally it fires a TableChanged-EventListener to update the UI.
SQLException
- If the auto-generated id can't resolved from the db, i.e.
it hasnt been generated, or the PreparedStatement
instance can't be created or executed etc.public void updateDB() throws SQLException
SeminarType
object into a database record and
updates a existing record to the changes made. Finally it fires a
TableChanged-EventListener to update the UI.
SQLException
- If the PreparedStatement instance can't be created or
executed, this exception is thrown.public static void removeFromDB(Iterable selectedElements) throws SQLException
selectedElements
- the elements, which should be deleted from the database.
SQLException
- Throws a SQL exception if the Statement instance can't be
created or executed.private static DistinctVector<SeminarType> getVector(ResultSet resultSet)
resultSet
- given ResultSet instance.
SeminarType
instances.public static DistinctVector<SeminarType> getVectorFromDB(Vector<DBConstraint> additionalConstraints, String sortString) throws SQLException
additionalConstraints
- additional conditions of the WHERE-clausesortString
- sort string with the following structure
ORDER BY attribute [ASC|DSC]
SQLException
- if the PreparedStatement can't be created or the
execution of the query fails.public static SeminarType getSeminarTypeFromDB(int semTypeId) throws SQLException
SeminarType
object.
semTypeId
- the DB-ID of the wanted SeminarType
object
SeminarType
object corresponding to the given id or
null if the data record does not exist.
SQLException
- if the PreparedStatement can't be created or the
execution of the query fails.public static Vector<DBColumn> getColumns()
DBColumn
instances according to
the properties of the table corresponding to this class.
AbstractTable.getColumns(String tableAbbreviation)
public String getAudience()
public void setAudience(String audience)
public Float getCharge()
public void setCharge(Float charge)
public String getDocuments()
public void setDocuments(String documents)
public Integer getDuration()
public void setDuration(Integer duration)
public Integer getMaxEntrants()
public void setMaxEntrants(Integer maxEntrants)
public String getMethodology()
public void setMethodology(String methodology)
public Integer getMinEntrants()
public void setMinEntrants(Integer minEntrants)
public String getObjective()
public void setObjective(String objective)
public String getRequirements()
public void setRequirements(String requirements)
public String getRoutine()
public void setRoutine(String routine)
public String getShortTitle()
public void setShortTitle(String shortTitle)
public String getTitle()
public void setTitle(String title)
public String getTopic()
public void setTopic(String topic)
public int getId()
SimpleIDKey
getId
in interface SimpleIDKey
public static SeminarType getNext(int semTypeId)
SeminarType
object according to the data
record which has the next bigger id.
semTypeId
- the key of the current record
SeminarType
instance corresponding to the next record
in the table "seminartype" or if it does not exist the object
with the smallest id.AbstractTable.getNext(String, DBColumn, int)
public static SeminarType getPrevious(int semTypeId)
SeminarType
instance according to the
record which has the next smaller id.
semTypeId
- the key of the current record
SeminarType
instance corresponding to the previous
record in the table "seminartype" or if it does not exist the
object with the biggest id.AbstractTable.getPrevious(String, DBColumn, int)
public static DistinctVector<SeminarType> getSemTypeConductedBy(int lecturerId) throws SQLException
lecturerId
- the id of the lecturer of interest
SeminarType
instances.
SQLException
- if the PreparedStatement can't be created or the
execution of the query fails.public int hashCode()
hashCode
in class Object
public boolean equals(SeminarType otherSeminarType)
otherSeminarType
- object to be compared with the actual object.
true
if the id of the given object and the actual
object are the same, false
otherwise.public boolean equals(Object otherSeminarType)
SeminarType
class this
method compares the id of the given and the actual object, otherwise it
calls the equal-method of the AbstractTable class with the given object.
equals
in class Object
otherSeminarType
- object to be compared with the actual object.
true
if the id of the given object and the actual
object are the same, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |