public class SurveyJpaController extends Object implements Serializable
| Constructor and Description |
|---|
SurveyJpaController(javax.persistence.EntityManagerFactory emf)
Instantiates a new survey jpa controller.
|
| Modifier and Type | Method and Description |
|---|---|
void |
create(Survey survey)
Creates the.
|
void |
destroy(Integer id)
Destroy.
|
void |
edit(Survey survey)
Edits the.
|
List<Survey> |
findAllSurveys(long groupid)
Find all surveys.
|
Survey |
findSurvey(Integer id)
Find survey.
|
List<Survey> |
findSurveyEntities()
Find survey entities.
|
List<Survey> |
findSurveyEntities(int maxResults,
int firstResult)
Find survey entities.
|
List<Survey> |
findSurveysByUser(int idusercreator,
long groupid)
Find surveys by user.
|
List<Survey> |
findSurveysByUserIdCreator(int idusercreator)
Find surveys by user id creator.
|
javax.persistence.EntityManager |
getEntityManager()
Gets the entity manager.
|
int |
getSurveyCount()
Gets the survey count.
|
public SurveyJpaController(javax.persistence.EntityManagerFactory emf)
emf - the emfpublic javax.persistence.EntityManager getEntityManager()
public void create(Survey survey)
survey - the surveypublic void edit(Survey survey) throws IllegalOrphanException, NonexistentEntityException, Exception
survey - the surveyIllegalOrphanException - the illegal orphan exceptionNonexistentEntityException - the nonexistent entity exceptionException - the exceptionpublic void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException
id - the idIllegalOrphanException - the illegal orphan exceptionNonexistentEntityException - the nonexistent entity exceptionpublic List<Survey> findSurveyEntities(int maxResults, int firstResult)
maxResults - the max resultsfirstResult - the first resultpublic Survey findSurvey(Integer id)
id - the idpublic int getSurveyCount()
public List<Survey> findSurveysByUserIdCreator(int idusercreator)
idusercreator - the idusercreatorpublic List<Survey> findSurveysByUser(int idusercreator, long groupid)
idusercreator - the idusercreatorgroupid - the groupidCopyright © 2018. All Rights Reserved.