@SuppressWarnings({"cast","unchecked"}) public List<DeviceInfo> listDeviceInfo(){
  EntityManager mgr=getEntityManager();
  List<DeviceInfo> result=new ArrayList<DeviceInfo>();
  try {
    Query query=mgr.createQuery("select from DeviceInfo");
    for (    Object obj : (List<Object>)query.getResultList()) {
      result.add(((DeviceInfo)obj));
    }
  }
  finally {
    mgr.close();
  }
  return result;
}

@ SuppressWarnings ( { "cast" , "unchecked" } ) public List < DeviceInfo > listDeviceInfo ( ) { EntityManager mgr = getEntityManager ( ) ; List < DeviceInfo > result = new ArrayList < DeviceInfo > ( ) ; try { Query query = mgr . createQuery ( "select from DeviceInfo" ) ; for ( Object obj : ( List < Object > ) query . getResultList ( ) ) { result . add ( ( ( DeviceInfo ) obj ) ) ; } } finally { mgr . close ( ) ; } return result ; }
this method lists all the entities inserted in datastore . it uses http get method .
