|
||||||||||
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
public class Presentation
The super class for all presentation classes. It encapsulates all common properties and methods of this classes.
Field Summary | |
---|---|
protected String |
annex
The annex. |
protected Date |
beginningDay
The day when the presentation begins. |
protected boolean |
cancelled
true if the presentation is canceled, false otherwise. |
protected String |
city
The city. |
protected String |
country
The country. |
private static String |
createTableSQLString
SQL statement for creating the table "presentation" (if not exists). |
protected Integer |
duration
The duration of the presentation. |
protected Date |
endingDay
The last day of the presentation. |
protected Time |
endingTime
The time when the presentation ends. |
protected Time |
firstStartingTime
The time when the presentation starts at the beginning day. |
protected int |
id
The DB-ID. |
private static String |
instructQueryString
SQL query to get all presentations which are instructed by certain lecturer. |
protected Time |
lastEndingTime
The time when the presentation ends at the ending day. |
protected String |
location
The location of the presentation (such as the room). |
static List<Integer> |
lockedIds
A list of the ids of locked records. |
protected static String |
presentationInsertString
SQL query to insert a presentation record. |
private static String |
presentationQueryString
SQL query to get all presentations of a certain seminartype. |
protected static String |
presentationUpdateString
SQL query to update a presentation record. |
private static String |
queryString
SQL query to get all presentation records from the database. |
protected int |
seminarTypeId
The id of the corresponding seminartype. |
protected Time |
startingTime
The time when the presentation begins. |
protected String |
street
The street. |
private static String |
superviseQueryString
SQL query to get all presentations supervised by a certain lecturer. |
private static String |
tableName
The name of the corresponding table in the db. |
protected String |
zipCode
The zip code. |
Fields inherited from class semorg.sql.tables.AbstractTable |
---|
creationDate, modificationDate, NULL_ID |
Constructor Summary | |
---|---|
protected |
Presentation(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,
Timestamp creationDate,
Timestamp modificationDate)
Initializes the common properties of all presentations with the given parameters. |
Method Summary | |
---|---|
static void |
createPresentationTable(Statement statement)
Creates the table "presentation" if it does not exist. |
boolean |
equals(Object otherPresentation)
If the given object is an instance of the Presentation 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. |
String |
getAnnex()
|
Date |
getBeginningDay()
|
String |
getCity()
|
static Vector<DBColumn> |
getColumns()
Returns a vector of DBColumn instances according to
the properties of the table "presentation". |
static Vector<DBColumn> |
getColumnsWithSemtype()
Returns a Vector of DBColumn objects for the current
Presentation instance. |
String |
getCountry()
|
Integer |
getDuration()
|
Date |
getEndingDay()
|
Time |
getEndingTime()
|
Time |
getFirstStartingTime()
|
int |
getId()
Returns the DB-ID of a database records. |
Time |
getLastEndingTime()
|
String |
getLocation()
|
static Presentation |
getPresentation(int presentationId)
Returns for given id the corresponding Presentation object. |
static DistinctVector<Presentation> |
getPresentationVectorFromDB(Vector<DBConstraint> additionalConstraints,
String sortString)
Creates a PreparedStatement instance with the given parameters, executes the query and returns a vector of Presentation instances corresponding to the ResultSet of the query. |
static DistinctVector<Presentation> |
getPresForSemType(int semTypeId)
Returns all presentations which possess the given seminartype. |
static DistinctVector<Presentation> |
getPresInstructedBy(int lecturerId)
Returns all presentations which are instructed by a lecturer corresponding to the given id. |
static DistinctVector<Presentation> |
getPresSupervisedBy(int lecturerId)
Returns all presentations which are supervised by a lecturer corresponding to the given id. |
String |
getSeminarTypeDescription()
Returns the shortened title of the seminartype corresponding to the current Presentation object. |
static SeminarType |
getSeminarTypeForPresId(int presId)
Returns the seminartype for the given presentation id. |
int |
getSeminarTypeId()
|
String |
getShortDescription()
Returns a String composed of the id of the current presentation and the shortened title of the corresponding seminartype. |
Time |
getStartingTime()
|
String |
getStreet()
|
private static DistinctVector<Presentation> |
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. |
String |
getZipCode()
|
int |
hashCode()
Returns the id. |
int |
insertIntoDB()
Converts the actual Presentation object into a database record and inserts it into the table presentation. |
boolean |
isCancelled()
|
static void |
removeFromDB(Iterable selectedElements)
Removes the given elements from the table "presentation". |
void |
setAnnex(String annex)
|
void |
setBeginningDay(Date beginningDay)
|
void |
setCancelled(boolean cancelled)
|
void |
setCity(String city)
|
void |
setCountry(String country)
|
void |
setDuration(Integer duration)
|
void |
setEndingDay(Date endingDay)
|
void |
setEndingTime(Time endingTime)
|
void |
setFirstStartingTime(Time firstStartingTime)
|
void |
setLastEndingTime(Time lastEndingTime)
|
void |
setLocation(String location)
|
void |
setSeminarTypeId(int seminarTypeId)
|
void |
setStartingTime(Time startingTime)
|
void |
setStreet(String street)
|
void |
setZipCode(String zipCode)
|
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 |
---|
public static List<Integer> lockedIds
protected int id
protected int seminarTypeId
protected Integer duration
protected Date beginningDay
protected Date endingDay
protected Time startingTime
protected Time endingTime
protected Time firstStartingTime
protected Time lastEndingTime
protected String location
protected String street
protected String zipCode
protected String city
protected String country
protected String annex
protected boolean cancelled
private static String tableName
private static String superviseQueryString
private static String instructQueryString
private static String presentationQueryString
private static String queryString
protected static String presentationInsertString
private static String createTableSQLString
protected static String presentationUpdateString
Constructor Detail |
---|
protected Presentation(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, Timestamp creationDate, Timestamp modificationDate) throws SQLException
SQLException
Method Detail |
---|
public String getSeminarTypeDescription()
Presentation
object.
public static boolean tableOK()
true
, if the table is ok, false
otherwise.AbstractTable.tableOK(String)
public static void createPresentationTable(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. 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.
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
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.
SQLException
- If the PreparedStatement instance can't be created or
executed, this exception is thrown.public static void removeFromDB(Iterable selectedElements) throws SQLException
Hint: The given elements should be ONLY deleted from the table "presentation", i.e. NOT in the extending classes/tables, because the rest is done by the dbms in order to fulfill a FK-constraint with an ON-DELETE-cascade.
Due to the FK connections (with an ON-DELETE-cascade) this method fires several TableChanged-Events to update the UI.
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.public static Vector<DBColumn> getColumns()
DBColumn
instances according to
the properties of the table "presentation". Note that this function maps
the names of the database columns to the names of the GUI tables.
AbstractTable.getColumns(String tableAbbreviation)
private static DistinctVector<Presentation> getVector(ResultSet resultSet)
resultSet
- given ResultSet instance.
Presentation
instances.public static DistinctVector<Presentation> getPresSupervisedBy(int lecturerId) throws SQLException
lecturerId
- id of the supervising lecturer
DistinctVector
instance filled with all presentations
which are supervised by the given lecturer.
SQLException
- Throws a SQL exception if the Statement instance can't be
created or executed.public static DistinctVector<Presentation> getPresInstructedBy(int lecturerId) throws SQLException
lecturerId
- id of the instructing lecturer
DistinctVector
instance filled with all presentations
which are instructed by the given lecturer.
SQLException
- Throws a SQL exception if the Statement instance can't be
created or executed.public static DistinctVector<Presentation> getPresForSemType(int semTypeId) throws SQLException
semTypeId
- id of the seminartype
DistinctVector
instance filled with all presentations
which possess the given seminartype.
SQLException
- Throws a SQL exception if the Statement instance can't be
created or executed.public static DistinctVector<Presentation> getPresentationVectorFromDB(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 this exception is thrown.public static Presentation getPresentation(int presentationId) throws SQLException
Presentation
object.
presentationId
- id of the wanted Presentation
instance.
Presentation
object corresponding to the given id.
SQLException
- if the PreparedStatement can't be created or the
execution of the query fails.getPresentationVectorFromDB(Vector, String)
public static Vector<DBColumn> getColumnsWithSemtype()
Vector
of DBColumn
objects for the current
Presentation
instance.DBColumn
which contains the shortened title of the corresponding
SeminarType
.
public int hashCode()
hashCode
in class Object
public boolean equals(Object otherPresentation)
equals
in class Object
otherPresentation
- 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 String getShortDescription()
public static SeminarType getSeminarTypeForPresId(int presId) throws SQLException
presId
- the id of the presentation
SeminarType
instance corresponding to the presenation
SQLException
- SQLException if the PreparedStatement can't be created or
the execution of the query fails.SeminarType.getSeminarTypeFromDB(int)
public String getAnnex()
public void setAnnex(String annex)
public Date getBeginningDay()
public void setBeginningDay(Date beginningDay)
public boolean isCancelled()
public void setCancelled(boolean cancelled)
public String getCity()
public void setCity(String city)
public String getCountry()
public void setCountry(String country)
public Integer getDuration()
public void setDuration(Integer duration)
public Date getEndingDay()
public void setEndingDay(Date endingDay)
public Time getEndingTime()
public void setEndingTime(Time endingTime)
public Time getFirstStartingTime()
public void setFirstStartingTime(Time firstStartingTime)
public Time getLastEndingTime()
public void setLastEndingTime(Time lastEndingTime)
public String getLocation()
public void setLocation(String location)
public int getSeminarTypeId()
public void setSeminarTypeId(int seminarTypeId)
public Time getStartingTime()
public void setStartingTime(Time startingTime)
public String getStreet()
public void setStreet(String street)
public String getZipCode()
public void setZipCode(String zipCode)
public int getId()
SimpleIDKey
getId
in interface SimpleIDKey
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |