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
cities by name and region. |
Constructor and Description |
---|
City()
No-argument constructor for JPA.
|
City(String name)
Creates a new city with the specified name.
|
Modifier and Type | Method and Description |
---|---|
Country |
getCountry()
Returns the country that the city is in.
|
County |
getCounty()
Returns the county that the city is in.
|
String |
getLink()
Returns a URL String, typically either a Google query or Google map link.
|
State |
getState()
Returns the state that the city is in.
|
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
cities.
For example:
TypedQuery<City> query = em.createNamedQuery(City.FIND_ALL, City.class);
public static final String FIND_BY_NAME
String
that represents the NamedQuery
to create a TypedQuery
to get all
states by name.
For example:
TypedQuery<City> query = em.createNamedQuery(City.FIND_BY_NAME, City.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
cities by name and region.
For example:
TypedQuery<City> query = em.createNamedQuery(City.FIND_BY_NAME_AND_REGION, City.class); query.setParameter("name", name); query.setParameter("region", region);
public City()
public City(String name)
name
- the name of the citypublic County getCounty()
public Country getCountry()
public State getState()
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