|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.hs_rm.cs.lecturenotes.server.core.persistence.dao.AbstractDAO<Exercise>
de.hs_rm.cs.lecturenotes.server.core.persistence.dao.ExerciseDAO
public final class ExerciseDAO
Data Access Object for System Entity Paragraph. A bunch of core editor
functionality resides in LectureSelectHandler
.
Field Summary | |
---|---|
static java.lang.String |
SQL_TABLENAME
SQL Table Name. |
Fields inherited from class de.hs_rm.cs.lecturenotes.server.core.persistence.dao.AbstractDAO |
---|
SQL_DELETEALL_TEMPLATE, SQL_DROP_TEMPLATE |
Fields inherited from interface de.hs_rm.cs.lecturenotes.server.core.persistence.dao.IDAO |
---|
SQLERRORCODE_DUPLICATE_ENTRY |
Constructor Summary | |
---|---|
ExerciseDAO(SQLConnection db)
DAO Constructor. |
Method Summary | |
---|---|
java.lang.Long |
createEntity(Exercise entity)
Creates an entity of type T and returns the inserted id. |
java.util.List<Exercise> |
getEntityListBySQL(java.lang.String sql)
Will return all lectures by String sql . |
java.util.List<Exercise> |
getExercisesByParaId(long paraId,
ExerciseAttributeEnum orderAttribute,
SQLSortDirectionEnum sortDirection)
Will return a List of Exercise objects for a
Paragraph with long paraId . |
java.lang.Integer |
hardDeleteEntity(Exercise entity)
Hard deletes Exercise . |
java.lang.Integer |
updateEntity(Exercise entity)
Will update a Exercise entity and return the number of rows
that were updated, which must be one. |
Methods inherited from class de.hs_rm.cs.lecturenotes.server.core.persistence.dao.AbstractDAO |
---|
createEntity, deleteTableContents, dropTable, executeCreateSQL, executeUpdateSQL, getDb, setDb |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SQL_TABLENAME
Constructor Detail |
---|
public ExerciseDAO(SQLConnection db)
db
- SQLConnection
connectionMethod Detail |
---|
public java.util.List<Exercise> getEntityListBySQL(java.lang.String sql)
String sql
. This method does not
fetch the paragraphs.
sql
- String
Lecture
public java.util.List<Exercise> getExercisesByParaId(long paraId, ExerciseAttributeEnum orderAttribute, SQLSortDirectionEnum sortDirection)
List
of Exercise
objects for a
Paragraph
with long paraId
.
paraId
- long
orderAttribute
- ExerciseAttributeEnum
sortDirection
- SQLSortDirectionEnum
List
of Exercise
public java.lang.Long createEntity(Exercise entity) throws java.sql.SQLException
IDAO
T
and returns the inserted id.
Throws SQLException in case of a duplicated entry or other DBMS problems.
entity
- T
Long
Id of the freshly inserted row. Must be not
null and should be above 0.
java.sql.SQLException
- Exception thrown. Here to indicate a duplicate entry to the
outside world.public java.lang.Integer updateEntity(Exercise entity)
Exercise
entity and return the number of rows
that were updated, which must be one. If the number is not one a failure
had occurred. Notice: Ownership will not be updated
entity
- Exercise
.
Integer
Number of rows that were updatedpublic java.lang.Integer hardDeleteEntity(Exercise entity)
Exercise
.
entity
- Exercise
Integer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |