/*
 *  The MIT License (MIT)
 *
 *  View the full license at:
 *  https://github.com/hendrixjoseph/FamilyTree/blob/master/LICENSE.md
 *
 *  Copyright (c) 2015 Joseph Hendrix
 *
 *  Hosted on GitHub at https://github.com/hendrixjoseph/FamilyTree
 *
 */

package edu.wright.hendrix11.familyTree.entity.place;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

/**
 * @author Joe
 */
@Entity
@DiscriminatorValue(value = "cemetery")
@NamedQueries({
                      @NamedQuery(name = Cemetery.FIND_BY_NAME,
                                  query = "SELECT p FROM Cemetery p WHERE p.name = :name"),
                      @NamedQuery(name = Cemetery.FIND_ALL, query = "SELECT p FROM Cemetery p")
              })
public class Cemetery extends Place
{
    /**
     * Specifies the {@link String} that represents the {@link NamedQuery} to create a {@link TypedQuery} to get all
     * cemeteries.
     * <p>
     * For example: {@code TypedQuery<Cemetery> query = em.createNamedQuery(Cemetery.FIND_ALL, Cemetery.class);}
     */
    public static final String FIND_ALL = "Cemetery.findAll";

    /**
     * Specifies the {@link String} that represents the {@link NamedQuery} to create a {@link TypedQuery} to get all
     * cemeteries by name.
     * <p>
     * For example: {@code TypedQuery<Cemetery> query = em.createNamedQuery(Cemetery.FIND_BY_NAME, Cemetery.class);}
     * {@code query.setParameter("name", name);
     */
    public static final String FIND_BY_NAME = "Cemetery.findByName";

    /**
     * No-argument constructor for JPA.
     */
    public Cemetery()
    {
    }

    /**
     * @param name the name of the cemetery
     */
    public Cemetery(String name)
    {
        super(name);
    }

    /**
     * Returns the city that the cemetery is in.
     *
     * @return the city that the cemetery is in
     */
    public City getCity()
    {
        return (City) getRegionByClass(City.class);
    }

    /**
     * Returns the county that the cemetery is in.
     *
     * @return the county that the cemetery is in
     */
    public County getCounty()
    {
        return (County) getRegionByClass(County.class);
    }

    /**
     * Returns the country that the cemetery is in.
     *
     * @return the country that the cemetery is in
     */
    public Country getCountry()
    {
        return (Country) getRegionByClass(Country.class);
    }

    /**
     * Returns the state that the cemetery is in.
     *
     * @return the state that the cemetery is in
     */
    public State getState()
    {
        return (State) getRegionByClass(State.class);
    }

    /**
     * {@inheritDoc}
     *
     * @return {@inheritDoc}
     */
    @Override
    public String getLink()
    {
        return super.queryLink(toString());
    }
}

@@ -1017,32 +1017,57 @@
  * For example: 
+%0A     * %3Cblockquote%3E%3Cpre%3E
 %7B@code TypedQuer
@@ -1139,24 +1139,24 @@
 ry.class);%7D%0A
-
      */%0A    
@@ -1397,16 +1397,41 @@
 xample: 
+%0A     * %3Cblockquote%3E%3Cpre%3E
 %7B@code T
@@ -1521,23 +1521,15 @@
 ss);
-%7D
 %0A     *
- %7B@code
  que
@@ -1554,24 +1554,44 @@
 ame%22, name);
+%7D%3C/pre%3E%3C/blockquote%3E
 %0A     */%0A   
@@ -1744,32 +1744,32 @@
    %7B%0A    %7D%0A%0A
-
     /**%0A
      * @para
@@ -1752,24 +1752,87 @@
  %7D%0A%0A    /**%0A
+     * Creates a new cemetery with the specified name.%0A     * %0A
      * @para

Update Cemetery.java