Package de.forsthaus.backend.model

Examples of de.forsthaus.backend.model.CountryCode


          // if found than get the CountryCode object for it and save
          // all
          if (ipToCountry != null) {
            final String code2 = ipToCountry.getIpcCountryCode2();
            final CountryCode sysCC = getCountryCodeService().getCountryCodeByCode2(code2);

            if (sysCC != null) {
              final Ip2Country ip2 = getIp2CountryService().getNewIp2Country();
              ip2.setCountryCode(sysCC);
View Full Code Here


            if (logger.isDebugEnabled()) {
              logger.debug("hostLookUp resolved for : " + secLoginlog.getLglIp());
            }

            final CountryCode sysCC = getCountryCodeService().getCountryCodeByCode2(ipl.getCountryCode());
            ip2.setCountryCode(sysCC);

            ip2.setI2cCity(ipl.getCity());
            ip2.setI2cLatitude(ipl.getLatitude());
            ip2.setI2cLongitude(ipl.getLongitude());
View Full Code Here

@Repository
public class CountryCodeDAOImpl extends BasisDAO<CountryCode> implements CountryCodeDAO {

  @Override
  public CountryCode getNewCountryCode() {
    return new CountryCode();
  }
View Full Code Here

  // ############################## Tests ##################################

  @Test
  @Transactional
  public void getNewCountryCode() {
    CountryCode obj = getCountryCodeDAO().getNewCountryCode();
    Assert.assertEquals("Not the expected result", Long.MIN_VALUE+1, obj.getId());
  }
View Full Code Here

  }

  @Test
  @Transactional
  public void getCountryCodeById() {
    CountryCode obj = getCountryCodeDAO().getCountryCodeById(new Long(5));
    Assert.assertEquals("Not the expected result", "AD", obj.getCcdCode2());
  }
View Full Code Here

  }

  @Test
  @Transactional
  public void getCountryCodeByCode2() {
    CountryCode obj = getCountryCodeDAO().getCountryCodeByCode2("DE");
    Assert.assertEquals("Not the expected result", "GERMANY", obj.getCcdName());
  }
View Full Code Here

  }

  @Test
  @Transactional
  public void saveOrUpdateCountryCode() {
    CountryCode entity = getCountryCodeDAO().getNewCountryCode();
    entity.setCcdCode2("XX");
    entity.setCcdName("testcode");

    getCountryCodeDAO().saveOrUpdate(entity);

    List<CountryCode> list = getCountryCodeDAO().getAllCountryCodes();
    for (CountryCode obj : list) {
      System.out.println(obj.getId() + " / " + obj.getCcdName());
    }

    CountryCode obj2 = getCountryCodeDAO().getCountryCodeByCode2("xx");
    Assert.assertEquals("Not the expected result", "UNROUTABLE ADDRESS", obj2.getCcdName());
  }
View Full Code Here

  }

  @Test
  @Transactional
  public void deleteCountryCode() {
    CountryCode entity = getCountryCodeDAO().getNewCountryCode();
    entity.setCcdCode2("XX");
    entity.setCcdName("testcode");

    getCountryCodeDAO().saveOrUpdate(entity);

    List<CountryCode> list = getCountryCodeDAO().getAllCountryCodes();
    for (CountryCode obj : list) {
      System.out.println(obj.getId() + " / " + obj.getCcdName());
    }

    CountryCode obj2 = getCountryCodeDAO().getCountryCodeByCode2("xx");
    Assert.assertEquals("Not the expected result", "UNROUTABLE ADDRESS", obj2.getCcdName());

    getCountryCodeDAO().delete(entity);
  }
View Full Code Here

  }

  @Test
  @Transactional
  public void saveCountryCode() {
    CountryCode entity = getCountryCodeDAO().getNewCountryCode();
    entity.setCcdCode2("XX");
    entity.setCcdName("testcode");

    getCountryCodeDAO().saveOrUpdate(entity);

    List<CountryCode> list = getCountryCodeDAO().getAllCountryCodes();
    for (CountryCode obj : list) {
      System.out.println(obj.getId() + " / " + obj.getCcdName());
    }

    CountryCode obj2 = getCountryCodeDAO().getCountryCodeByCode2("xx");
    Assert.assertEquals("Not the expected result", "UNROUTABLE ADDRESS", obj2.getCcdName());
  }
View Full Code Here

      // Fill with the related data for Ip2Country
      final Ip2Country ip2 = secLoginlog.getIp2Country();
      if (ip2 != null) {
        // Fill with the related data for CountryCode
        final CountryCode cc = ip2.getCountryCode();
        if (cc != null) {
        }

      }
    }
View Full Code Here

TOP

Related Classes of de.forsthaus.backend.model.CountryCode

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.