예제 #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");
 }
예제 #2
0
 @Override
 public void insertAddresses(List<HunterAddress> addresses) {
   logger.debug("Inserting address...");
   HunterHibernateHelper.saveEntity(addresses);
   ;
   logger.debug("Successfully inserted hunter address!");
 }
예제 #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;
 }
예제 #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;
 }
예제 #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;
 }
예제 #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;
 }
예제 #7
0
 @Override
 public void updateAddress(HunterAddress update) {
   logger.debug("Updating hunter address >> " + update);
   HunterHibernateHelper.updateEntity(update);
   logger.debug("Successfully updated hunter address!");
 }
예제 #8
0
 @Override
 public void deleteAddress(HunterAddress address) {
   logger.debug("Deleting address ... ");
   HunterHibernateHelper.deleteEntity(address);
   logger.debug("Sucessfully deleted address");
 }
예제 #9
0
 @Override
 public void insertAddress(HunterAddress address) {
   logger.debug("Inserting address...");
   HunterHibernateHelper.saveEntity(address);
   logger.debug("Finished inserting address");
 }