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 |
|---|---|
boolean |
checkDBisCreated()
Check D bis created.
|
boolean |
checkSurveyIsAnonymous(int idSurveySelected)
Check survey is anonymous.
|
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.
|
int |
findSurveyIdByTitle(String surveyTitle)
Find survey id by title.
|
List<Survey> |
findSurveysByUser(int idusercreator,
long groupid)
Find surveys by user.
|
javax.persistence.EntityManager |
getEntityManager()
Gets the entity manager.
|
int |
getSurveyCount()
Gets the survey count.
|
void |
updateSurvey(SurveyModel surveyModel)
Update survey.
|
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> findSurveysByUser(int idusercreator, long groupid)
idusercreator - the idusercreatorgroupid - the groupidpublic int findSurveyIdByTitle(String surveyTitle)
surveyTitle - the survey titlepublic List<Survey> findAllSurveys(long groupid)
groupid - the groupidpublic void updateSurvey(SurveyModel surveyModel)
surveyModel - the survey modelpublic boolean checkDBisCreated()
public boolean checkSurveyIsAnonymous(int idSurveySelected)
idSurveySelected - the id survey selectedCopyright © 2017. All Rights Reserved.