Examples of Country


Examples of org.hibernate.search.test.engine.Country

  private void prepareData() {
    Session session = openSession();
    FullTextSession fullTextSession = Search.getFullTextSession( session );
    Transaction transaction = fullTextSession.beginTransaction();
    Country italy = new Country( "Italy", 39d );
    for ( int i = 0; i < NUM_LOCATIONS; i++ ) {
      session.persist( new Location( i, Long.valueOf( i ), 7 * i, Double.valueOf( 9 * i ), Integer
          .valueOf( 100 - i ), String.valueOf( i ) + "42", null, italy, BigDecimal.ONE ) );
    }
    transaction.commit();
View Full Code Here

Examples of org.hibernate.test.annotations.Country

  }

  public void testAttributedJoin() throws Exception {
    Session s = openSession();
    s.getTransaction().begin();
    Country country = new Country();
    country.setName( "Australia" );
    s.persist( country );

    Boy boy = new Boy();
    boy.setFirstName( "John" );
    boy.setLastName( "Doe" );
    CountryAttitude attitude = new CountryAttitude();
    // TODO: doesn't work
    attitude.setBoy( boy );
    attitude.setCountry( country );
    attitude.setLikes( true );
    boy.getCountryAttitudes().add( attitude );
    s.persist( boy );
    s.getTransaction().commit();
    s.clear();

    Transaction tx = s.beginTransaction();
    boy = (Boy) s.get( Boy.class, boy.getId() );
    assertTrue( boy.getCountryAttitudes().contains( attitude ) );
    s.delete( boy );
    s.delete( s.get( Country.class, country.getId() ) );
    tx.commit();
    s.close();

  }
View Full Code Here

Examples of org.infinispan.query.indexedembedded.Country

   }

   public void testPersistence() throws PersistenceException, ParseException {
      verifyFullTextHasMatches(0);

      Country italy = new Country();
      italy.countryName = "Italy";
      City rome = new City();
      rome.name = "Rome";
      italy.cities.add(rome);

      cache.put("IT", italy);
      assert ! store.contains("IT");

      verifyFullTextHasMatches(1);

      cache.evict("IT");
      assert store.contains("IT");

      InternalCacheEntry internalCacheEntry = cache.getAdvancedCache().getDataContainer().get("IT");
      assert internalCacheEntry==null;

      verifyFullTextHasMatches(1);

      Country country = cache.get("IT");
      assert country != null;
      assert "Italy".equals(country.countryName);

      verifyFullTextHasMatches(1);
View Full Code Here

Examples of org.infinispan.query.indexedembedded.Country

   }

   public void testPersistence() throws CacheLoaderException, ParseException {
      verifyFullTextHasMatches(0);

      Country italy = new Country();
      italy.countryName = "Italy";
      City rome = new City();
      rome.name = "Rome";
      italy.cities.add(rome);

      cache.put("IT", italy);
      assert ! store.containsKey("IT");

      verifyFullTextHasMatches(1);

      cache.evict("IT");
      assert store.containsKey("IT");

      InternalCacheEntry internalCacheEntry = cache.getAdvancedCache().getDataContainer().get("IT");
      assert internalCacheEntry==null;

      verifyFullTextHasMatches(1);

      Country country = cache.get("IT");
      assert country != null;
      assert "Italy".equals(country.countryName);

      verifyFullTextHasMatches(1);
View Full Code Here

Examples of org.infinispan.query.indexedembedded.Country

   }

   public void testPersistence() throws PersistenceException, ParseException {
      verifyFullTextHasMatches(0);

      Country italy = new Country();
      italy.countryName = "Italy";
      City rome = new City();
      rome.name = "Rome";
      italy.cities.add(rome);

      cache.put("IT", italy);
      assert ! store.contains("IT");

      verifyFullTextHasMatches(1);

      cache.evict("IT");
      assert store.contains("IT");

      InternalCacheEntry internalCacheEntry = cache.getAdvancedCache().getDataContainer().get("IT");
      assert internalCacheEntry==null;

      verifyFullTextHasMatches(1);

      Country country = cache.get("IT");
      assert country != null;
      assert "Italy".equals(country.countryName);

      verifyFullTextHasMatches(1);
View Full Code Here

Examples of org.internna.iwebmvc.model.Country

            Entry<Locale, Properties>[] entries = iso3166.toArray(new Entry[0]);
            String[] codes = entries[0].getValue().stringPropertyNames().toArray(new String[0]);
            for (String code : codes) {
                if (logger.isDebugEnabled()) logger.debug("Creating country [" + code + "]");
                try {
                    Country country = new Country();
                    country.setIsoCodeAlpha(code);
                    country.setCountry(new I18nText());
                    for (int index = 0; index < entries.length; index++)
                      country.getCountry().add(entries[index].getKey(), entries[index].getValue().getProperty(code));
                    country.setDefaultCountry(code.equals(defaultCountry));
                    dao.create(country, false);
                    if (count++ % 25 == 0) {
                        dao.flush();
                        dao.clear();
                    }
View Full Code Here

Examples of org.jayasoft.woj.portal.model.geography.Country

    }
    return price;
  }
   
  private double getTax(Purchaser purchaser) {
    Country c = Portal.getInstance().getGeographyService().getCountryFromName(purchaser.getCountry());
    if (c.isInEEC()) {
      if (Portal.getInstance().getGeographyService().isFrance(c)) {
        return FRENCH_TAX;
      } else if (Purchaser.COMPANY.equals(purchaser.getType()) && StringUtils.isBlank(purchaser.getEECIdent())) {
        return FRENCH_TAX;       
      } else if (Purchaser.USER.equals(purchaser.getType())) {
View Full Code Here

Examples of org.jsondoc.sample.pojo.Country

  public @ResponseBody @ApiResponseObject Country getCountryByName(@PathVariable @ApiParam(name="name", paramType=ApiParamType.PATH) String name) {
    List<City> cities = new ArrayList<City>();
    cities.add(new City("Sydney", 19329, 43));
    cities.add(new City("Melbourne", 85743, 12));
    cities.add(new City("Perth", 58735, 39));
    return new Country(32198, 5487, "Australia", cities, Continent.AUSTRALIA);
  }
View Full Code Here

Examples of org.nutz.dao.test.meta.Country

    assertEquals(1, dao.count("dao_country"));

    sql = Sqls.create("UPDATE dao_country SET detail=@detail WHERE name=@name");
    sql.params().set("name", "ABC").set("detail", null);
    dao.execute(sql);
    Country c = dao.fetch(Country.class, "ABC");
    assertNull(c.getDetail());
  }
View Full Code Here

Examples of org.nutz.dao.test.meta.Country

    b.setLevel(45);
    b.getCountry().setName("ABC");
    dao.updateLinks(b, "country");
    b = dao.fetch(Base.class, "red");
    assertEquals(lv, b.getLevel());
    Country c = dao.fetch(Country.class, b.getCountryId());
    assertEquals("ABC", c.getName());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.