|
||||||||||
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.Presentation
semorg.sql.tables.PublicPresentation
public class PublicPresentation
Models a public presentation.
Field Summary | |
---|---|
private Float |
cancelFee
The cancel fee of a public presentation. |
private String |
coopPartner
The name of the co-operation partner. |
private static String |
createTableSQLString
SQL statement for creating the table "publicpresentation" (if not exists). |
private String |
publicPresentationCurrentEntrantsString
The number of current entrants of a public presentation. |
private static String |
publicPresentationInsertString
Parameterized SQL statement for inserting a public presentation. |
private static String |
publicPresentationUpdateString
Parameterized SQL statement for updating a public presentation. |
private static String |
queryString
SQL query to get all "public presentation" records from the database. |
private static String |
tableName
The name of the corresponding db table. |
Fields inherited from class semorg.sql.tables.Presentation |
---|
annex, beginningDay, cancelled, city, country, duration, endingDay, endingTime, firstStartingTime, id, lastEndingTime, location, lockedIds, presentationInsertString, presentationUpdateString, seminarTypeId, startingTime, street, zipCode |
Fields inherited from class semorg.sql.tables.AbstractTable |
---|
creationDate, modificationDate, NULL_ID |
Constructor Summary | |
---|---|
PublicPresentation(int id,
int seminarTypeId,
Integer duration,
Date beginningDay,
Date endingDay,
Time startingTime,
Time endingTime,
Time firstStartingTime,
Time lastEndingTime,
String location,
String street,
String zipCode,
String city,
String country,
String annex,
boolean cancelled,
String coopPartner,
Float cancelFee,
Timestamp creationDate,
Timestamp modificationDate)
Creates an instance of the class PublicPresentation with the given parameters. |
Method Summary | |
---|---|
static void |
createPublicPresentationTable(Statement statement)
Creates the table "publicpresentation" if it does not exist. |
Float |
getCancelFee()
|
static Vector<DBColumn> |
getColumns()
Returns a vector of DBColumn instances according to
the properties of the table "publicpresentation". |
static Vector<DBColumn> |
getColumnsWithSemtype()
Returns a Vector of DBColumn objects for the current
PublicPresentation instance. |
String |
getCoopPartner()
|
int |
getCurrentEntrantsCount()
Returns the number of the current entrants of this public presentation. |
static PublicPresentation |
getNext(int currentId)
Returns for a DB-ID the PublicPresentation instance according to
the record which has the next bigger id. |
static PublicPresentation |
getPrevious(int currentId)
Returns for a DB-ID the PublicPresentation instance according to
the record which has the next smaller id. |
static PublicPresentation |
getPublicPresentation(int presentationId)
Provides for a given id the corresponding public presentation. |
private static DistinctVector<PublicPresentation> |
getVector(ResultSet resultSet)
Creates for each element in a given ResultSet instance an PublicPresentation object and returns a vector with the resulting PublicPresentation instances. |
static DistinctVector<PublicPresentation> |
getVectorFromDB(Vector<DBConstraint> additionalConstraints,
String sortString)
Creates a PreparedStatement instance with the given parameters, executes the query and returns a vector of PublicPresentation instances
corresponding to the ResultSet of the query. |
int |
insertIntoDB()
Converts the actual Presentation object into a database record and inserts it into the table presentation. |
void |
setCancelFee(Float cancelFee)
|
void |
setCoopPartner(String coopPartner)
|
static boolean |
tableOK()
Checks if the according DB table exists. |
void |
updateDB()
Converts the actual Presentation 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 |
---|
private String coopPartner
private Float cancelFee
private String publicPresentationCurrentEntrantsString
private static String tableName
private static String queryString
private static String publicPresentationInsertString
private static String publicPresentationUpdateString
private static String createTableSQLString
Constructor Detail |
---|
public PublicPresentation(int id, int seminarTypeId, Integer duration, Date beginningDay, Date endingDay, Time startingTime, Time endingTime, Time firstStartingTime, Time lastEndingTime, String location, String street, String zipCode, String city, String country, String annex, boolean cancelled, String coopPartner, Float cancelFee, Timestamp creationDate, Timestamp modificationDate) throws SQLException
SQLException
Method Detail |
---|
private static DistinctVector<PublicPresentation> getVector(ResultSet resultSet)
resultSet
- given ResultSet instance.
PublicPresentation
instances.public static DistinctVector<PublicPresentation> getVectorFromDB(Vector<DBConstraint> additionalConstraints, String sortString) throws SQLException
PublicPresentation
instances
corresponding to the ResultSet of the query.
additionalConstraints
- additional conditions of the WHERE-clausesortString
- sort string with the following structure
ORDER BY attribute [ASC|DSC]
PublicPresentation
instances.
SQLException
- if the PreparedStatement can't be created or the
execution of the query fails.public static boolean tableOK()
true
, if the table is ok, false
otherwise.AbstractTable.tableOK(String)
public static void createPublicPresentationTable(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
Presentation
Presentation.id
and
returns the id. If a country or annex has been inserted into the form,
this method also inserts the concerning properties into the table
"enumeration" for later use. Finally it fires a
TableChanged-EventListener to update the UI.
insertIntoDB
in class Presentation
SQLException
- If the auto-generated id can't resolved from the db, i.e.
it hasn't been generated, or the PreparedStatement
instance can't be created or executed etc.public void updateDB() throws SQLException
Presentation
Presentation
object into a database record
and updates a existing record to the changes made. If a country or annex
has been inserted into the form, this method also inserts the concerning
properties into the table "enumeration" for later use. Finally it fires a
TableChanged-EventListener to update the UI.
updateDB
in class Presentation
SQLException
- If the PreparedStatement instance can't be created or
executed, this exception is thrown.public static Vector<DBColumn> getColumns()
DBColumn
instances according to
the properties of the table "publicpresentation". Note that this function
maps the names of the database columns to the names of the GUI tables.
AbstractTable.getColumns(String tableAbbreviation)
public static Vector<DBColumn> getColumnsWithSemtype()
Vector
of DBColumn
objects for the current
PublicPresentation
instance.DBColumn
which contains the shortened title of the corresponding
SeminarType
.
public String getCoopPartner()
public void setCoopPartner(String coopPartner)
public Float getCancelFee()
public void setCancelFee(Float cancelFee)
public static PublicPresentation getNext(int currentId)
PublicPresentation
instance according to
the record which has the next bigger id.
currentId
- the key of the current record
PublicPresentation
instance corresponding to the next
record in the table "publicpresentation" or if it does not exist
the PublicPresentation
instance with the smallest id.AbstractTable.getNext(String, DBColumn, int)
public static PublicPresentation getPrevious(int currentId)
PublicPresentation
instance according to
the record which has the next smaller id.
currentId
- the key of the current record
PublicPresentation
instance corresponding to the
previous record in the table "publicpresentation" or if it does
not exist the PublicPresentation
instance with the
biggest id.AbstractTable.getPrevious(String, DBColumn, int)
public static PublicPresentation getPublicPresentation(int presentationId) throws SQLException
presentationId
- the id of a presentation
PublicPresentation
instances which meets the conditions mentioned above.
SQLException
- If the creation, manipulation, execution or closing of a
PreparedStatement instance used for querying the database
fails.public int getCurrentEntrantsCount() throws SQLException
SQLException
- If the creation, manipulation, execution or closing of a
PreparedStatement instance used for querying the database
fails. Of if the database delivers a empty result set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |