Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.Country


    protected boolean isStateCodeRequired(String siteId, String countryCode) throws SecurityException, Exception {
      if (Format.isNullOrEmpty(countryCode)) {
        return false;
      }
     
      Country country = CountryDAO.loadByCountryCode(siteId, countryCode);
      if (country.getStates().size() > 0) {
        return true;
      }
      return false;
    }
View Full Code Here


      Query query = em.createQuery("from country in class Country where country.siteId = :siteId order by country.countryName");
      query.setParameter("siteId", siteId);
       Iterator<?> iterator = query.getResultList().iterator();
       Vector<LabelValueBean> vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         Country country = (Country) iterator.next();
         LabelValueBean bean = new LabelValueBean(country.getCountryName(), country.getCountryCode());
         vector.add(bean);
       }
       LabelValueBean countries[] = new LabelValueBean[vector.size()];
       vector.copyInto(countries);
       form.setCountries(countries);
View Full Code Here

      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
      Iterator<Country> iterator = taxRegion.getCountries().iterator();
      Vector<JSONEscapeObject> countries = new Vector<JSONEscapeObject>();
      while (iterator.hasNext()) {
        Country country = (Country) iterator.next();
        JSONEscapeObject object = new JSONEscapeObject();
        object.put("countryId", country.getCountryId());
        object.put("countryCode", country.getCountryCode());
        object.put("countryName", country.getCountryName());
        countries.add(object);
      }
      jsonResult.put("countries", countries);
      Iterator<State> iterator1 = taxRegion.getStates().iterator();
      Vector<JSONEscapeObject> states = new Vector<JSONEscapeObject>();
View Full Code Here

      String countryIds[] = form.getCountryIds();
      if (countryIds != null) {
        for (int i = 0; i < countryIds.length; i++) {
          Long countryId = Format.getLong(countryIds[i]);
              Country country = (Country) em.find(Country.class, countryId);
              Iterator<?> countries = taxRegion.getCountries().iterator();
              boolean found = false;
              while (countries.hasNext()) {
                Country c = (Country) countries.next();
                if (c.getCountryId().equals(countryId)) {
                  found = true;
                  break;
                }
              }
              if (!found) {
View Full Code Here

      if (countryIds != null) {
        for (int i = 0; i < countryIds.length; i++) {
          Long countryId = Format.getLong(countryIds[i]);
              Iterator<?> countries = taxRegion.getCountries().iterator();
              while (countries.hasNext()) {
                Country c = (Country) countries.next();
                if (c.getCountryId().equals(countryId)) {
                  countries.remove();
                  modified = true;
                  break;
                }
              }
View Full Code Here

        sql = "from Country where siteId = :siteId";
        query = em.createQuery(sql);
        query.setParameter("siteId", site.getSiteId());
        iterator = query.getResultList().iterator();
        while (iterator.hasNext()) {
          Country country = (Country) iterator.next();
          em.remove(country);
        }
        site.setSiteCurrencyClassDefault(null);
        site.setSiteProfileClassDefault(null);
View Full Code Here

        String sql = "from Country country where siteId = :siteId order by countryCode";
        Query query = em.createQuery(sql);
        query.setParameter("siteId", Constants.SITE_SYSTEM);
        Iterator<?> iterator = query.getResultList().iterator();
        while (iterator.hasNext()) {
          Country master = (Country) iterator.next();
          Country country = new Country();
          PropertyUtils.copyProperties(country, master);
          country.setSite(site);
          country.setCountryId(null);
          country.setRecUpdateBy(userId);
          country.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
          country.setRecCreateBy(userId);
          country.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          country.setShippingRegion(null);
          country.setStates(null);
          country.setTaxes(null);
          em.persist(country);
        }
  }
View Full Code Here

          state.setRecUpdateBy(userId);
          state.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
          state.setRecCreateBy(userId);
          state.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          state.setShippingRegion(null);
          Country mc = master.getCountry();
          Country country = null;
          if (mc != null) {
            country = CountryDAO.loadByCountryName(site.getSiteId(), mc.getCountryName());
          }
          state.setCountry(country);
          state.setTaxes(null);
View Full Code Here

      Query query = em.createQuery("from country in class Country where country.siteId = :siteId");
      query.setParameter("siteId", siteId);
       Iterator<?> iterator = query.getResultList().iterator();
       Vector<LabelValueBean> vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         Country country = (Country) iterator.next();
         LabelValueBean bean = new LabelValueBean(country.getCountryName(), country.getCountryCode());
         vector.add(bean);
       }
       LabelValueBean countries[] = new LabelValueBean[vector.size()];
       vector.copyInto(countries);
       form.setCountries(countries);
View Full Code Here

      tax.setStates(states);
          Iterator<?> it = null;
          if (master.getCountries() != null) {
            it = master.getCountries().iterator();
            while (it.hasNext()) {
              Country mc = (Country) it.next();
              Country country = CountryDAO.loadByCountryName(site.getSiteId(), mc.getCountryName());
              tax.getCountries().add(country);
            }
          }
          if (master.getStates() != null) {
            it = master.getStates().iterator();
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.Country

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.