Package org.gtugs.domain

Examples of org.gtugs.domain.Location


  public void incrementOrStoreLocation(Double latitude,
      Double longitude) {
    PersistenceManager pm = getPersistenceManager();

    String key = latitude + ";" + longitude;
    Location location = null;

    try {
      location = pm.getObjectById(Location.class, key);

      if (location != null) {
        location.setOccurrences(location.getOccurrences() + 1);
        pm.makePersistent(location);
      }
    } catch (JDOObjectNotFoundException e) {
      location = new Location(key, latitude, longitude);
      pm.makePersistent(location);
    } finally {
      pm.close();
    }
  }
View Full Code Here

TOP

Related Classes of org.gtugs.domain.Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.