de.hs_rm.cs.lecturenotes.server.core.persistence.factory
Class UserFactory

java.lang.Object
  extended by de.hs_rm.cs.lecturenotes.server.core.persistence.factory.UserFactory
All Implemented Interfaces:
IEntityFactory<User>

public final class UserFactory
extends java.lang.Object
implements IEntityFactory<User>

The UserFactory is an abstract factory for the corresponding DAO and creates products to be used in data management.

Version:
$LastChangedRevision: 266 $
Author:
Enrico Homann

Constructor Summary
UserFactory()
           
 
Method Summary
 java.sql.PreparedStatement createPreparedStatementInsertFromEntity(java.sql.Connection conn, User entity)
          Creates a PreparedStatement for insert purpose.
 User createProductFromResultSet(SQLConnection conn, java.sql.ResultSet rs)
          Creates the Entity Product from a given ResultSet.
static UserFactory getInstance()
          Returns the Singleton for this Factory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserFactory

public UserFactory()
Method Detail

getInstance

public static UserFactory getInstance()
Returns the Singleton for this Factory.

Returns:
UserFactory

createProductFromResultSet

public User createProductFromResultSet(SQLConnection conn,
                                       java.sql.ResultSet rs)
Description copied from interface: IEntityFactory
Creates the Entity Product from a given ResultSet. Connection conn may be used for inner connections.

Specified by:
createProductFromResultSet in interface IEntityFactory<User>
Parameters:
conn - SQLConnection
rs - ResultSet
Returns:
T

createPreparedStatementInsertFromEntity

public java.sql.PreparedStatement createPreparedStatementInsertFromEntity(java.sql.Connection conn,
                                                                          User entity)
                                                                   throws java.sql.SQLException
Description copied from interface: IEntityFactory
Creates a PreparedStatement for insert purpose.

Specified by:
createPreparedStatementInsertFromEntity in interface IEntityFactory<User>
Parameters:
conn - Connection of the JDBC
entity - T Entity
Returns:
PreparedStatement to be used with the JDBC
Throws:
java.sql.SQLException - Exception possibly thrown