Ejemplo n.º 1
0
 @Override
 public void deleteAddressById(Long id) {
   logger.debug("Deleting address for id >> " + id);
   HunterAddress hunterAddress = HunterHibernateHelper.getEntityById(id, HunterAddress.class);
   HunterHibernateHelper.deleteEntity(hunterAddress);
   logger.debug("Finished deleting addres by id");
 }
Ejemplo n.º 2
0
 @Override
 public void insertAddresses(List<HunterAddress> addresses) {
   logger.debug("Inserting address...");
   HunterHibernateHelper.saveEntity(addresses);
   ;
   logger.debug("Successfully inserted hunter address!");
 }
Ejemplo n.º 3
0
 @Override
 public List<HunterAddress> getAllAddresses() {
   logger.debug("Fetching all hunter addresses");
   List<HunterAddress> addresses = HunterHibernateHelper.getAllEntities(HunterAddress.class);
   logger.debug("Successfully returned addresses size( " + addresses.size() + " )");
   return addresses;
 }
Ejemplo n.º 4
0
 @Override
 public HunterAddress getAddressById(Long id) {
   logger.debug("Getting address for id >> " + id);
   HunterAddress address = HunterHibernateHelper.getEntityById(id, HunterAddress.class);
   logger.debug("Obtained addres >> " + address);
   return address;
 }
Ejemplo n.º 5
0
 @Override
 public Long getNextAddressId() {
   logger.debug("Obtaining next address id");
   Long maxId =
       HunterHibernateHelper.getMaxEntityIdAsNumber(HunterAddress.class, Long.class, "id");
   maxId = maxId == null ? 1 : maxId + 1;
   logger.debug("Successfully obtained next address Id >> " + maxId);
   return maxId;
 }
Ejemplo n.º 6
0
 @Override
 public List<HunterAddress> getAddressesByUserId(Long userId) {
   logger.debug("Fetching addresses for user id : " + userId + "...");
   String query = "FROM HunterAddress h WHERE h.userId = " + userId;
   List<HunterAddress> hunterAddresses =
       HunterHibernateHelper.executeQueryForObjList(HunterAddress.class, query);
   logger.debug(
       "Finished fetching addresses ! Size ( "
           + (hunterAddresses != null ? hunterAddresses.size() : 0)
           + " )");
   return hunterAddresses;
 }
Ejemplo n.º 7
0
 @Override
 public void updateAddress(HunterAddress update) {
   logger.debug("Updating hunter address >> " + update);
   HunterHibernateHelper.updateEntity(update);
   logger.debug("Successfully updated hunter address!");
 }
Ejemplo n.º 8
0
 @Override
 public void deleteAddress(HunterAddress address) {
   logger.debug("Deleting address ... ");
   HunterHibernateHelper.deleteEntity(address);
   logger.debug("Sucessfully deleted address");
 }
Ejemplo n.º 9
0
 @Override
 public void insertAddress(HunterAddress address) {
   logger.debug("Inserting address...");
   HunterHibernateHelper.saveEntity(address);
   logger.debug("Finished inserting address");
 }