public class EventEJB extends Object
| Constructor and Description |
|---|
EventEJB() |
| Modifier and Type | Method and Description |
|---|---|
void |
createEvent(es.uvigo.esei.dgss.lettab.domain.Event event) |
List<es.uvigo.esei.dgss.lettab.domain.Event> |
getFiveRandomEvents() |
List<es.uvigo.esei.dgss.lettab.domain.Event> |
getPopularEvents(int numEvents) |
void |
linkEventToUser(es.uvigo.esei.dgss.lettab.domain.User participant,
es.uvigo.esei.dgss.lettab.domain.Event event) |
static int |
randInt(int min,
int max) |
@PermitAll public List<es.uvigo.esei.dgss.lettab.domain.Event> getFiveRandomEvents()
@PermitAll public List<es.uvigo.esei.dgss.lettab.domain.Event> getPopularEvents(int numEvents)
@PermitAll public static int randInt(int min, int max)
@PermitAll public void linkEventToUser(es.uvigo.esei.dgss.lettab.domain.User participant, es.uvigo.esei.dgss.lettab.domain.Event event)
participant - The user that is linked to an eventevent - Event assigned to a user@PermitAll public void createEvent(es.uvigo.esei.dgss.lettab.domain.Event event) throws IllegalArgumentException, javax.persistence.EntityExistsException, javax.persistence.PersistenceException
event - The event that we want to persistIllegalArgumentException - When the event we want to persist is nulljavax.persistence.PersistenceException - Happens when there is any error with the persistencejavax.persistence.EntityExistsExceptionCopyright © 2016. All rights reserved.