|
||||||||||
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.Person
semorg.sql.tables.Lecturer
public class Lecturer
Models a person in the role of a lecturer.
Field Summary | |
---|---|
private String |
bio
The biography of the lecturer. |
private static String |
conductQueryString
SQL query to get all lecturer who conduct a certain presentation. |
private static String |
createTableSQLString
SQL statement for creating the table "lecturer" (if not exists). |
private Float |
dailyFee
The daily fee. |
private Float |
hourlyFee
The hourly fee. |
private static String |
instructQueryString
SQL query to get all lecturer who instruct a certain presentation. |
private static String |
lecturerInsertString
SQL query to insert a lecturer record. |
private static String |
lecturerUpdateString
SQL query to update a lecturer record. |
private static String |
queryString
SQL query to get all lecturer records from the database. |
private static String |
superviseQueryString
SQL query to get all lecturer who supervise a certain presentation. |
private static String |
tableName
The name of the corresponding db table. |
Fields inherited from class semorg.sql.tables.Person |
---|
annex, birthday, city, country, email, fax, firstContact, firstname, id, lockedIds, mobile, name, notices, personInsertString, personUpdateString, phone, salutation, shortinfo, street, title, zipCode |
Fields inherited from class semorg.sql.tables.AbstractTable |
---|
creationDate, modificationDate, NULL_ID |
Constructor Summary | |
---|---|
Lecturer(int id,
String salutation,
String title,
String firstname,
String name,
String street,
String zipCode,
String city,
String country,
String annex,
String phone,
String mobile,
String fax,
String email,
Date birthday,
Date firstContact,
String bio,
Float dailyFee,
Float hourlyFee,
String shortinfo,
String notices,
Timestamp creationDate,
Timestamp modificationDate)
Creates an instance of the class Lecturer with the given parameters. |
Method Summary | |
---|---|
static void |
createLecturerTable(Statement statement)
Creates the table "lecturer" if it does not exist. |
String |
getBio()
|
static Vector<DBColumn> |
getColumns()
Returns a vector of DBColumn instances according to
the properties of the tables "person" and "lecturer". |
Float |
getDailyFee()
|
Float |
getHourlyFee()
|
static DistinctVector<Lecturer> |
getLectConducting(int seminarTypeId)
Provides for a given presentation id all lecturers who conduct the presentation according to the given id. |
static DistinctVector<Lecturer> |
getLectInstructing(int presentationId)
Provides for a given presentation id all lecturers who instruct the presentation according to the given id. |
static DistinctVector<Lecturer> |
getLectSupervising(int presentationId)
Provides for a given presentation id all lecturers who supervise the presentation according to the given id. |
static Lecturer |
getNext(int lecturerId)
Returns for a DB-ID the Lecturer instance according to the record which has the next bigger id. |
static Lecturer |
getPrevious(int lecturerId)
Returns for a DB-ID the Lecturer instance according to the record which has the next smaller id. |
private static DistinctVector<Lecturer> |
getVector(ResultSet resultSet)
Creates for each element in a given ResultSet instance an Lecturer object and returns a vector with the resulting Lecturer instances. |
static DistinctVector<Lecturer> |
getVectorFromDB(Vector<DBConstraint> additionalConstraints,
String sortString)
Creates a PreparedStatement instance with the given parameters, executes the query and returns a vector of Lecturer instances corresponding to the ResultSet of the query. |
int |
insertIntoDB()
Inserts a lecturer record into the db. |
void |
setBio(String bio)
|
void |
setDailyFee(Float dailyFee)
|
void |
setHourlyFee(Float hourlyFee)
|
static boolean |
tableOK()
Checks if the according DB table exists. |
void |
updateDB()
Updates a lecturer record in the database. |
Methods inherited from class semorg.sql.tables.Person |
---|
createPersonTable, equals, getAnnex, getBirthday, getCity, getCountry, getEmail, getFax, getFirstContact, getFirstname, getId, getMobile, getName, getNotices, getPhone, getSalutation, getShortinfo, getStreet, getTitle, getZipCode, hashCode, removeFromDB, setAnnex, setBirthday, setCity, setCountry, setEmail, setFax, setFirstContact, setFirstname, setMobile, setName, setNotices, setNumber, setPhone, setSalutation, setShortinfo, setStreet, setTitle, setZipCode |
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 bio
private Float dailyFee
private Float hourlyFee
private static String tableName
private static String queryString
private static String instructQueryString
private static String superviseQueryString
private static String conductQueryString
private static String lecturerInsertString
private static String lecturerUpdateString
private static String createTableSQLString
Constructor Detail |
---|
public Lecturer(int id, String salutation, String title, String firstname, String name, String street, String zipCode, String city, String country, String annex, String phone, String mobile, String fax, String email, Date birthday, Date firstContact, String bio, Float dailyFee, Float hourlyFee, String shortinfo, String notices, Timestamp creationDate, Timestamp modificationDate)
Method Detail |
---|
private static DistinctVector<Lecturer> getVector(ResultSet resultSet)
resultSet
- given ResultSet instance.
public static DistinctVector<Lecturer> 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 this exception is thrown.public static boolean tableOK()
true
, if the table is ok, false
otherwise.AbstractTable.tableOK(String)
public static void createLecturerTable(Statement statement) throws SQLException
statement
- instance of the class Statement, which is used for
executing the SQL statement createTableSQLString
.
SQLException
- If the execution or closing of the given statement fails.public int insertIntoDB() throws SQLException
insertIntoDB
in class Person
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.Person.insertIntoDB()
public void updateDB() throws SQLException
updateDB
in class Person
SQLException
- If the PreparedStatement instance can't be created or
executed, this exception is thrown.Person.updateDB()
public static Vector<DBColumn> getColumns()
DBColumn
instances according to
the properties of the tables "person" and "lecturer".
Person.getColumns()
,
AbstractTable.getColumns(String tableAbbreviation)
public String getBio()
public void setBio(String bio)
public Float getDailyFee()
public void setDailyFee(Float dailyFee)
public Float getHourlyFee()
public void setHourlyFee(Float hourlyFee)
public static Lecturer getNext(int lecturerId)
lecturerId
- the key of the current record
AbstractTable.getNext(String, DBColumn, int)
public static Lecturer getPrevious(int lecturerId)
lecturerId
- the key of the current record
AbstractTable.getPrevious(String, DBColumn, int)
public static DistinctVector<Lecturer> getLectInstructing(int presentationId) throws SQLException
presentationId
- the id of a presentation
SQLException
- If the creation, manipulation, execution or closing of a
PreparedStatement instance used for querying the database
fails.public static DistinctVector<Lecturer> getLectSupervising(int presentationId) throws SQLException
presentationId
- the id of a presentation
SQLException
- If the creation, manipulation, execution or closing of a
PreparedStatement instance used for querying the database
fails.public static DistinctVector<Lecturer> getLectConducting(int seminarTypeId) throws SQLException
seminarTypeId
- the id of a presentation
SQLException
- If the creation, manipulation, execution or closing of a
PreparedStatement instance used for querying the database
fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |