|
||||||||||
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.CompanyInternalPresentation
public class CompanyInternalPresentation
This class models a company internal presentation.
Field Summary | |
---|---|
private String |
companyInternalPresentationCurrentEntrantsString
SQL query to retrieve the current number of entrants. |
private static String |
companyInternalPresentationInsertString
Parameterized SQL statement for inserting a company internal presentation. |
private static String |
companyInternalPresentationUpdateString
Parameterized SQL statement for updating a company internal presentation. |
private static String |
createTableSQLString
SQL statement for creating the table "publicpresentation" (if not exists). |
protected Integer |
maxEntrants
The maximal number of entrants. |
private Float |
packagePrice
The package prize of the company internal presentation. |
private static String |
queryString
SQL query to get all "company internal 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 | |
---|---|
CompanyInternalPresentation(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,
Float packagePrice,
Integer maxEntrants,
Timestamp creationDate,
Timestamp modificationDate)
Creates an instance of the class CompanyInternalPresentation with
the given parameters. |
Method Summary | |
---|---|
static void |
createCompanyInternalPresentationTable(Statement statement)
Creates the table "companyintenalpresentation" if it does not exist. |
static Vector<DBColumn> |
getColumns()
Returns a vector of DBColumn instances according to
the properties of the table "companyinternalpresentation". |
static Vector<DBColumn> |
getColumnsWithSemtype()
Returns a Vector of DBColumn objects for the current
CompanyInternalPresentation instance. |
static CompanyInternalPresentation |
getCompanyInternalPresentation(int presentationId)
Provides for a given id the corresponding company internal presentation. |
int |
getCurrentEntrantsCount()
Returns the number of the current entrants of this company internal presentation. |
Integer |
getMaxEntrants()
|
static CompanyInternalPresentation |
getNext(int currentId)
Returns for a DB-ID the CompanyInternalPresentation instance
according to the record which has the next bigger id. |
Float |
getPackagePrice()
|
static CompanyInternalPresentation |
getPrevious(int currentId)
Returns for a DB-ID the CompanyInternalPresentation instance
according to the record which has the next smaller id. |
private static DistinctVector<CompanyInternalPresentation> |
getVector(ResultSet resultSet)
Creates for each element in a given ResultSet instance an CompanyInternalPresentation object and returns a vector with the
resulting instances. |
static DistinctVector<CompanyInternalPresentation> |
getVectorFromDB(Vector<DBConstraint> additionalConstraints,
String sortString)
Creates a PreparedStatement instance with the given parameters, executes the query and returns a vector of CompanyInternalPresentation
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 |
setMaxEntrants(Integer maxEntrants)
|
void |
setPackagePrice(Float packagePrice)
|
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 Float packagePrice
protected Integer maxEntrants
private String companyInternalPresentationCurrentEntrantsString
private static String tableName
private static String queryString
private static String companyInternalPresentationInsertString
private static String companyInternalPresentationUpdateString
private static String createTableSQLString
Constructor Detail |
---|
public CompanyInternalPresentation(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, Float packagePrice, Integer maxEntrants, Timestamp creationDate, Timestamp modificationDate) throws SQLException
CompanyInternalPresentation
with
the given parameters.
SQLException
Method Detail |
---|
private static DistinctVector<CompanyInternalPresentation> getVector(ResultSet resultSet)
CompanyInternalPresentation
object and returns a vector with the
resulting instances.
resultSet
- given ResultSet instance.
CompanyInternalPresentation
instances.public static DistinctVector<CompanyInternalPresentation> getVectorFromDB(Vector<DBConstraint> additionalConstraints, String sortString) throws SQLException
CompanyInternalPresentation
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]
CompanyInternalPresentation
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 createCompanyInternalPresentationTable(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 "companyinternalpresentation". 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
CompanyInternalPresentation
instance.DBColumn
which contains the shortened title of the corresponding
SeminarType
.
public static CompanyInternalPresentation getNext(int currentId)
CompanyInternalPresentation
instance
according to the record which has the next bigger id.
currentId
- the key of the current record
CompanyInternalPresentation
instance corresponding to
the next record in the table "companyinternalpresentation" or if
it does not exist the CompanyInternalPresentation
instance with the smallest id.AbstractTable.getNext(String, DBColumn, int)
public static CompanyInternalPresentation getPrevious(int currentId)
CompanyInternalPresentation
instance
according to the record which has the next smaller id.
currentId
- the key of the current record
CompanyInternalPresentation
instance corresponding to
the previous record in the table "companyinternalpresentation" or
if it does not exist the CompanyInternalPresentation
instance with the biggest id.AbstractTable.getPrevious(String, DBColumn, int)
public static CompanyInternalPresentation getCompanyInternalPresentation(int presentationId) throws SQLException
presentationId
- the id of a presentation
CompanyInternalPresentation
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.public Integer getMaxEntrants()
public void setMaxEntrants(Integer maxEntrants)
public Float getPackagePrice()
public void setPackagePrice(Float packagePrice)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |