|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.hsr.bieridee.models.AbstractModel
ch.hsr.bieridee.models.AbstractActionModel
ch.hsr.bieridee.models.ConsumptionModel
public class ConsumptionModel
Model to work with and persist the User object.
Constructor Summary | |
---|---|
ConsumptionModel(org.neo4j.graphdb.Node node)
Creates a UserModel, consisting from a User domain object and the corresponding Node. |
Method Summary | |
---|---|
static ConsumptionModel |
create(BeerModel beerModel,
UserModel userModel)
Creates a new user and returns a new UserModel for it. |
static java.util.List<ConsumptionModel> |
getAll(long beerId)
Gets all consumptions for the given beer. |
static java.util.List<ConsumptionModel> |
getAll(long beerId,
java.lang.String username)
Gets all consumptions of a specific user for the given beer. |
Consumption |
getDomainObject()
|
void |
setDate(java.util.Date d)
|
java.lang.String |
toString()
|
Methods inherited from class ch.hsr.bieridee.models.AbstractActionModel |
---|
getBeer, getDate, getSecondsAgo, getType, getUser |
Methods inherited from class ch.hsr.bieridee.models.AbstractModel |
---|
getNode |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConsumptionModel(org.neo4j.graphdb.Node node) throws org.neo4j.graphdb.NotFoundException, WrongNodeTypeException
node
- Ratingnode
org.neo4j.graphdb.NotFoundException
- Thrown if the given node can not been found
WrongNodeTypeException
- Thrown if the given node is not of type userMethod Detail |
---|
public Consumption getDomainObject()
getDomainObject
in class AbstractModel
public void setDate(java.util.Date d)
public static ConsumptionModel create(BeerModel beerModel, UserModel userModel)
beerModel
- The BeerModel.userModel
- The UserModel.
public static java.util.List<ConsumptionModel> getAll(long beerId) throws org.neo4j.graphdb.NotFoundException, WrongNodeTypeException
beerId
- The beer to be filterd with
org.neo4j.graphdb.NotFoundException
- Thrown if a node could not be found
WrongNodeTypeException
- Thronw if a node has the wrong typepublic static java.util.List<ConsumptionModel> getAll(long beerId, java.lang.String username) throws org.neo4j.graphdb.NotFoundException, WrongNodeTypeException
beerId
- The beer to be filterd withusername
- The drinker
org.neo4j.graphdb.NotFoundException
- Thrown if a node could not be found
WrongNodeTypeException
- Thronw if a node has the wrong typepublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |