Modifier and Type | Field and Description |
---|---|
static String |
FIND_ALL
|
static String |
FIND_BY_NAME
Specifies the
String that represents the NamedQuery to create a TypedQuery to get all
states by name. |
static String |
FIND_BY_NAME_AND_REGION
Specifies the
String that represents the NamedQuery to create a TypedQuery to get all
states by name and region. |
Constructor and Description |
---|
State()
No-argument constructor for JPA.
|
State(String name) |
Modifier and Type | Method and Description |
---|---|
Country |
getCountry()
Returns the country that the state is in.
|
String |
getLink()
Returns a URL String, typically either a Google query or Google map link.
|
equals, getId, getName, getPlaces, getRegion, hashCode, iterator, setId, setName, setRegion, toString
forEach, spliterator
public static final String FIND_ALL
String
that represents the NamedQuery
to create a TypedQuery
to get all
states.
For example:
TypedQuery<State> query = em.createNamedQuery(State.FIND_ALL, State.class);
}
public static final String FIND_BY_NAME
String
that represents the NamedQuery
to create a TypedQuery
to get all
states by name. It is expected, but not required, that only one state exists per name.
For example:
TypedQuery<State> query = em.createNamedQuery(State.FIND_BY_NAME, State.class); query.setParameter("name", name);
public static final String FIND_BY_NAME_AND_REGION
String
that represents the NamedQuery
to create a TypedQuery
to get all
states by name and region. It is expected, but not required, that only one state exists per name and region.
For example:
TypedQuery<State> query = em.createNamedQuery(State.FIND_BY_NAME_AND_REGION, State.class); query.setParameter("name", name); query.setParameter("region", region);
public State()
public State(String name)
name
- the name of the statepublic Country getCountry()
public String getLink()
"https://www.google.com/search?q="
while a Google map link follows the format "https://www.google.com/maps/place/"
.Copyright © 2015 Joseph Hendrix