Create Data.java

This code maps a path or route to the data being requested here via a GET call.

To add support for parameters, I converted the query params from the call into their appropriate data types from the MySQL database.

This class depends on/interacts with the following:

 1. a query object that extends the original query object class, with the usual getter and setter methods.

 2. a business object that handles the XML response to the web service consumer
     Example annotations:
@XmlRootElement(name = "data")
public class DataObject extends BusinessObject {
...
...
    @XmlElement
    public Long getId(){return id; }
    public void setId(Long id){this.id = id; }

 3. a domain object that enables queries to the database, describing the table entity and its structure. 
     Example to set a nullable attribute on a primary key field called "id":

    @Id
    @Column(name="id", nullable = true)
    public Long getId(){return id; }
    public void setId(Long id){this.id = id; }

 4. a dozer.xml file mapping the business and domain object with the transformer class, transformer factory class, and Dozer transformer class.

 5. a service class that is autowired into this JAX-RS class to define the actual query being executed within a Hibernate session.
     Example query building in service class:
@Service
@Transactional
public class GetDataService {

    @Autowired
    private SessionFactory factory;
    public List<DataObject> listDataByQuery(DataQueryObject queryObject ){
        Session session = factory.getCurrentSession();
        if(session != null){
            session = factory.getCurrentSession();
        }else{
            session = factory.openSession();
        }
      Criteria criteria = session.createCriteria(Data.class);
      if (queryObject != null) {
          if ( queryObject.getUserID() != null ) {
              criteria.add(Restrictions.eq("userID", queryObject.getUserID()));
          }
          if ( queryObject.getDataDate() != null ) {
              criteria.add(Restrictions.eq("dataDate", queryObject.getDataDate()));
          }
      }
//then create a data list from criteria.list() method, transform using transformer factory, and return the data objects returned by the factory
  }
}

 5. a jdbc.properties file or alternate data source that enumerates the connection parameters for the database.

 6. an applicationContext.xml file to configure hibernate sessions when connecting to the database.

 7. a hibernate.cfg.xml file to tell the Hibernate session factory about the mapping domain objects.

 8. a web.xml file to point to the locations of the applicationContext.xml, JAX-RS servlet name and URL mapping, and any context listeners you use.