de.hs_rm.cs.lecturenotes.server.core.persistence.dao
Interface IDAO<T>

Type Parameters:
T - type of entity
All Known Implementing Classes:
AbstractDAO, AnnotationDAO, ExerciseDAO, FilecardDAO, LectureDAO, ParagraphDAO, SlideDAO, UserDAO

public interface IDAO<T>

Create, Read, Update, Delete Interface for DAO methods.

Author:
Enrico Homann

Field Summary
static int SQLERRORCODE_DUPLICATE_ENTRY
          SQL Error Code for a duplicate entry.
 
Method Summary
 java.lang.Long createEntity(T entity)
          Creates an entity of type T and returns the inserted id.
 

Field Detail

SQLERRORCODE_DUPLICATE_ENTRY

static final int SQLERRORCODE_DUPLICATE_ENTRY
SQL Error Code for a duplicate entry.

See Also:
Constant Field Values
Method Detail

createEntity

java.lang.Long createEntity(T entity)
                            throws java.sql.SQLException
Creates an entity of type T and returns the inserted id. Throws SQLException in case of a duplicated entry or other DBMS problems.

Parameters:
entity - T
Returns:
Long Id of the freshly inserted row. Must be not null and should be above 0.
Throws:
java.sql.SQLException - Exception thrown. Here to indicate a duplicate entry to the outside world.