|
||||||||||
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.BreweryModel
public class BreweryModel
Model to work and persist the brewery object.
Constructor Summary | |
---|---|
BreweryModel(long breweryId)
Creates a BreweryModel by id. |
|
BreweryModel(org.neo4j.graphdb.Node node)
Creates a BreweryModel by Node. |
Method Summary | |
---|---|
static BreweryModel |
create(java.lang.String name,
java.lang.String description,
java.lang.String picture,
java.lang.String size)
Creates a new Brewery and saves it persistent into the database. |
static java.util.List<BreweryModel> |
getAll()
Gets a list of all breweries as BreweryModels . |
static java.util.List<BreweryModel> |
getAll(int items,
int skip)
|
static java.util.List<BreweryModel> |
getAll(java.lang.String brewerySize)
Gets a list of BeweryModels filtered by brewerySize. |
static java.util.List<BreweryModel> |
getAll(java.lang.String brewerySize,
int items,
int skip)
|
java.lang.String |
getDescription()
|
Brewery |
getDomainObject()
|
long |
getId()
|
java.lang.String |
getName()
|
org.neo4j.graphdb.Node |
getNode()
|
java.lang.String |
getPicture()
|
java.lang.String |
getSize()
|
static BreweryModel |
getUnknown()
Gets the BreweryModel for an unknown brewery. |
boolean |
isUnknown()
|
void |
setDescription(java.lang.String description)
|
void |
setId(long id)
|
void |
setName(java.lang.String name)
|
void |
setPicture(java.lang.String picture)
|
void |
setSize(java.lang.String size)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BreweryModel(long breweryId) throws WrongNodeTypeException, org.neo4j.graphdb.NotFoundException
BreweryModel
by id.
breweryId
- The id of the desired brewery
WrongNodeTypeException
- Thrown when the given id does not reference a brewery node
org.neo4j.graphdb.NotFoundException
- Thrown when the given id does not reference an existing nodepublic BreweryModel(org.neo4j.graphdb.Node node) throws WrongNodeTypeException, org.neo4j.graphdb.NotFoundException
BreweryModel
by Node.
node
- the node containing Brewery
properties.
WrongNodeTypeException
- Thrown when the given node is not of type beertype
org.neo4j.graphdb.NotFoundException
- Thrown when the given id does not reference an existing nodeMethod Detail |
---|
public boolean isUnknown()
public Brewery getDomainObject()
getDomainObject
in class AbstractModel
public org.neo4j.graphdb.Node getNode()
getNode
in class AbstractModel
public long getId()
public java.lang.String getDescription()
public java.lang.String getPicture()
public java.lang.String getName()
public java.lang.String getSize()
public void setId(long id)
public void setName(java.lang.String name)
public void setSize(java.lang.String size)
public void setDescription(java.lang.String description)
public void setPicture(java.lang.String picture)
public static java.util.List<BreweryModel> getAll() throws org.neo4j.graphdb.NotFoundException, WrongNodeTypeException
BreweryModels
.
org.neo4j.graphdb.NotFoundException
- Thrown if a node is not existant
WrongNodeTypeException
- Thrown if a node is not of the desired typepublic static java.util.List<BreweryModel> getAll(int items, int skip) throws org.neo4j.graphdb.NotFoundException, WrongNodeTypeException
org.neo4j.graphdb.NotFoundException
WrongNodeTypeException
public static java.util.List<BreweryModel> getAll(java.lang.String brewerySize) throws org.neo4j.graphdb.NotFoundException, WrongNodeTypeException
brewerySize
- The brewerySize
org.neo4j.graphdb.NotFoundException
- Thrown if a node is not existant
WrongNodeTypeException
- Thrown if a node is not of the desired typepublic static java.util.List<BreweryModel> getAll(java.lang.String brewerySize, int items, int skip) throws org.neo4j.graphdb.NotFoundException, WrongNodeTypeException
org.neo4j.graphdb.NotFoundException
WrongNodeTypeException
public static BreweryModel create(java.lang.String name, java.lang.String description, java.lang.String picture, java.lang.String size)
name
- name of the brewery.description
- text describing the brewerypicture
- path to the picturesize
- size of the brewery
BreweryModel
representing the created brewery.public static BreweryModel getUnknown() throws org.neo4j.graphdb.NotFoundException, WrongNodeTypeException
org.neo4j.graphdb.NotFoundException
- Thrown if a node is not existant
WrongNodeTypeException
- Thrown if a node is not of the desired type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |