|
||||||||||
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.RatingModel
public class RatingModel
Model to work with and persist the User object.
Constructor Summary | |
---|---|
RatingModel(org.neo4j.graphdb.Node node)
Creates a UserModel, consisting from a User domain object and the corresponding Node. |
Method Summary | |
---|---|
static RatingModel |
create(int value,
BeerModel beerModel,
UserModel userModel)
Creates a new user and returns a new UserModel for it. |
static java.util.List<RatingModel> |
createModelsFromNodes(java.util.List<org.neo4j.graphdb.Node> ratingNodes)
Creates RatingModels from ratingnodes. |
static RatingModel |
getCurrent(BeerModel beerModel,
UserModel userModel)
Gets the active rating for the given user and the given beer. |
Rating |
getDomainObject()
|
int |
getRating()
|
void |
setDate(java.util.Date d)
|
void |
setRating(int rating)
|
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, toString, wait, wait, wait |
Constructor Detail |
---|
public RatingModel(org.neo4j.graphdb.Node node) throws org.neo4j.graphdb.NotFoundException, WrongNodeTypeException
node
- Ratingnode
org.neo4j.graphdb.NotFoundException
- Thrown if the given node can not be found
WrongNodeTypeException
- Thrown if the given node is not of type userMethod Detail |
---|
public Rating getDomainObject()
getDomainObject
in class AbstractModel
public void setDate(java.util.Date d)
public void setRating(int rating)
public int getRating()
public static RatingModel create(int value, BeerModel beerModel, UserModel userModel)
value
- The rating value.beerModel
- The BeerModel.userModel
- The UserModel.
public static RatingModel getCurrent(BeerModel beerModel, UserModel userModel) throws org.neo4j.graphdb.NotFoundException, WrongNodeTypeException
beerModel
- The beermodeluserModel
- The usermodel
org.neo4j.graphdb.NotFoundException
- Thrown if the given node can not be found
WrongNodeTypeException
- Thrown if the given node is not of type userpublic static java.util.List<RatingModel> createModelsFromNodes(java.util.List<org.neo4j.graphdb.Node> ratingNodes) throws org.neo4j.graphdb.NotFoundException, WrongNodeTypeException
ratingNodes
- The nodes
org.neo4j.graphdb.NotFoundException
- Thrown if the given node can not be found
WrongNodeTypeException
- Thrown if the given node is not of type user
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |