ch.bouquet.jpa.persistence
Class AuthUserBean

java.lang.Object
  extended by ch.bouquet.jpa.persistence.AuthUserBean
All Implemented Interfaces:
java.io.Serializable

public class AuthUserBean
extends java.lang.Object
implements java.io.Serializable

CAS Enterprise Application Development mit Java EE (EADJ) - 2007
Modul: Data-Tier (JPA)
User admininstration (examination question)
Description:
This class encases the inquiries by JPQL on the table auth_user

Copyright (c) 2007 bouquet dot ch, 3032 Hinterkappelen. All rights reseved.

Version:
1.0 - 04.06.2007
Author:
Marc Bouquet ( marc at bouquet dot ch, Swiss )
See Also:
Serialized Form

Field Summary
private  javax.persistence.EntityManager em
          The entity manager
private static org.apache.log4j.Logger LOG
          constant for the logging
private static long serialVersionUID
          Default serial version uid
 
Constructor Summary
AuthUserBean(javax.persistence.EntityManager em)
          Default constructor.
 
Method Summary
 java.util.List<AuthUser> findList(java.lang.String sql)
          This method returns all data records on the basis the SQL instruction.
 AuthUser findSingle(java.lang.String sql)
          This method returns a data record on the basis the SQL instruction.
 long findSize(java.lang.String sql)
          This method returns the number of data records on the basis the SQL instruction.
 boolean remove(int id)
          Remove the authenticated user for the given key if available.
 AuthUser save(AuthUser authUser)
          Insert new or update existing authenticated user using the given entity and return the persistet fields of the authenticated user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Default serial version uid

See Also:
Constant Field Values

LOG

private static org.apache.log4j.Logger LOG
constant for the logging


em

private javax.persistence.EntityManager em
The entity manager

Constructor Detail

AuthUserBean

public AuthUserBean(javax.persistence.EntityManager em)
Default constructor.

Parameters:
em - EntityManager
Method Detail

findSingle

public AuthUser findSingle(java.lang.String sql)
                    throws javax.persistence.NoResultException
This method returns a data record on the basis the SQL instruction.

Parameters:
sql - String SQL-Query
Returns:
authenticated user found
Throws:
javax.persistence.NoResultException

findSize

public long findSize(java.lang.String sql)
This method returns the number of data records on the basis the SQL instruction.

Parameters:
sql - String SQL-Query
Returns:
size of count [0] or [n] hits

findList

public java.util.List<AuthUser> findList(java.lang.String sql)
This method returns all data records on the basis the SQL instruction.

Parameters:
sql - String SQL-Query
Returns:
list of authenticated users or null

remove

public boolean remove(int id)
               throws javax.persistence.NoResultException
Remove the authenticated user for the given key if available.

Parameters:
id - primary key
Returns:
true=removed, false=can't removed
Throws:
javax.persistence.NoResultException

save

public AuthUser save(AuthUser authUser)
              throws javax.persistence.NoResultException
Insert new or update existing authenticated user using the given entity and return the persistet fields of the authenticated user.

Parameters:
authUser - to save
Returns:
authUser saved or updated
Throws:
javax.persistence.NoResultException


Copyright © 2007 - bouquet dot ch, 3032 Hinterkappelen. All Rights Reserved.