Package cn.edu.zju.acm.onlinejudge.bean.enumeration

Examples of cn.edu.zju.acm.onlinejudge.bean.enumeration.Country


                            ps = conn.prepareStatement(UserPersistenceImpl.GET_ALL_COUNTRIES);
                            ResultSet rs = ps.executeQuery();

                            List<Country> countries = new ArrayList<Country>();
                            while (rs.next()) {
                                countries.add(new Country(rs.getLong(DatabaseConstants.COUNTRY_COUNTRY_ID),
                                                          rs.getString(DatabaseConstants.COUNTRY_NAME)));
                            }
                            this.allCountries = Collections.unmodifiableList(countries);
                        } finally {
                            Database.dispose(ps);
View Full Code Here


        profile.setLastName(rs.getString(DatabaseConstants.USER_PROFILE_LAST_NAME));
        profile.setAddressLine1(rs.getString(DatabaseConstants.USER_PROFILE_ADDRESS_LINE1));
        profile.setAddressLine2(rs.getString(DatabaseConstants.USER_PROFILE_ADDRESS_LINE2));
        profile.setCity(rs.getString(DatabaseConstants.USER_PROFILE_CITY));
        profile.setState(rs.getString(DatabaseConstants.USER_PROFILE_STATE));
        profile.setCountry(new Country(rs.getLong(DatabaseConstants.USER_PROFILE_COUNTRY_ID), "foo"));
        profile.setZipCode(rs.getString(DatabaseConstants.USER_PROFILE_ZIP_CODE));
        profile.setPhoneNumber(rs.getString(DatabaseConstants.USER_PROFILE_PHONE_NUMBER));
        profile.setBirthDate(rs.getDate(DatabaseConstants.USER_PROFILE_BIRTH_DATE));
        String gender = rs.getString(DatabaseConstants.USER_PROFILE_GENDER);
        profile.setGender(gender == null || gender.length() == 0 ? ' ' : gender.charAt(0));
View Full Code Here

    profile.setLastName("myLastName");
    profile.setAddressLine1("myAddressLine1");
    profile.setAddressLine2("myAddressLine2");
    profile.setCity("myCity");
    profile.setState("myState");
    profile.setCountry(new Country(1, "foo"));
    profile.setZipCode("myZipCode");
    profile.setPhoneNumber("myPhoneNumber");
    profile.setBirthDate(DateFormat.getDateInstance(DateFormat.SHORT, Locale.US).parse("1/1/1980"));
    profile.setGender('M');           
    profile.setSchool("mySchool");
View Full Code Here

    profile.setLastName("myNewLastName");
    profile.setAddressLine1("myNewAddressLine1");
    profile.setAddressLine2("myNewAddressLine2");
    profile.setCity("myNewCity");
    profile.setState("myNewState");
    profile.setCountry(new Country(2, "foo"));
    profile.setZipCode("myNewZipCode");
    profile.setPhoneNumber("myNewPhoneNumber");
    profile.setBirthDate(DateFormat.getDateInstance(DateFormat.SHORT, Locale.US).parse("1/1/1980"));
    profile.setGender('F');           
    profile.setSchool("myNewSchool");
View Full Code Here

   */
  public void testGetAllCountries() throws Exception {
    List countries = persistence.getAllCountries();
    assertTrue("wrong size", countries.size() > 0);
    for (Iterator it = countries.iterator(); it.hasNext();) {
      Country country = (Country) it.next();
      assertNotNull("wrong name", country.getName());           
    }       
  }
View Full Code Here

    profile.setLastName("myLastName");
    profile.setAddressLine1("myAddressLine1");
    profile.setAddressLine2("myAddressLine2");
    profile.setCity("myCity");
    profile.setState("myState");
    profile.setCountry(new Country(1, "foo"));
    profile.setZipCode("myZipCode");
    profile.setPhoneNumber("myPhoneNumber");
    profile.setBirthDate(DateFormat.getDateInstance(DateFormat.SHORT, Locale.US).parse("1/1/1980"));
    profile.setGender('M');           
    profile.setSchool("mySchool");
View Full Code Here

     *
     * @param errors
     *            the errors
     */
    private void checkCountry(ActionErrors errors) {
      Country c = null;
      try {
      if (this.country == null || this.country.trim().length() == 0) {
        c = PersistenceManager.getInstance().getCountry("China");
            //errors.add("country", new ActionMessage("ProfileForm.country.required"));
        } else {
View Full Code Here

    profile.setLastName("myLastName");
    profile.setAddressLine1("myAddressLine1");
    profile.setAddressLine2("myAddressLine2");
    profile.setCity("myCity");
    profile.setState("myState");
    profile.setCountry(new Country(1, "foo"));
    profile.setZipCode("myZipCode");
    profile.setPhoneNumber("myPhoneNumber");
    profile.setBirthDate(new Date(0));
    profile.setGender('M');           
    profile.setSchool("mySchool");
View Full Code Here

    profile.setLastName("myLastName");
    profile.setAddressLine1("myAddressLine1");
    profile.setAddressLine2("myAddressLine2");
    profile.setCity("myCity");
    profile.setState("myState");
    profile.setCountry(new Country(1, "foo"));
    profile.setZipCode("myZipCode");
    profile.setPhoneNumber("myPhoneNumber");
    profile.setBirthDate(DateFormat.getDateInstance(DateFormat.SHORT, Locale.US).parse("1/1/1980"));
    profile.setGender('M');           
    profile.setSchool("mySchool");
View Full Code Here

TOP

Related Classes of cn.edu.zju.acm.onlinejudge.bean.enumeration.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.