Package com.apress.prospring.ch9.domain

Examples of com.apress.prospring.ch9.domain.Permission


    testDao.save(test1);
    testDao.save(test2);
  }
 
  public void customer() {
    CustomerDao customerDao = (CustomerDao)context.getBean("customerDao");
    List customers = customerDao.getAll();
    for (Iterator i = customers.iterator(); i.hasNext();) {
      Customer customer = (Customer)i.next();
      System.out.println(customer);
    }
   
    customers = customerDao.getAllWithOnlyOnePermission();
    for (Iterator i = customers.iterator(); i.hasNext();) {
      Customer customer = (Customer)i.next();
      System.out.println(customer);
    }   
   
View Full Code Here


public class Main {
 
  private ApplicationContext context;
   
  private void test() {
    TestDao testDao = (TestDao)context.getBean("testDao");
    List tests = testDao.getAll();
    for (Iterator i = tests.iterator(); i.hasNext();) {
      Test test = (Test)i.next();
      System.out.println(test);
    }
   
    Test test1, test2;
    test1 = testDao.getById(1);
    test2 = testDao.getById(1);
    test1.setName("new Name");
    test2.setName("other name");
    testDao.save(test1);
    testDao.save(test2);
  }
View Full Code Here

 
  public void customer() {
    CustomerDao customerDao = (CustomerDao)context.getBean("customerDao");
    List customers = customerDao.getAll();
    for (Iterator i = customers.iterator(); i.hasNext();) {
      Customer customer = (Customer)i.next();
      System.out.println(customer);
    }
   
    customers = customerDao.getAllWithOnlyOnePermission();
    for (Iterator i = customers.iterator(); i.hasNext();) {
      Customer customer = (Customer)i.next();
      System.out.println(customer);
    }   
   
    Customer customer = new Customer();
    customer.setFirstName("Jack");
    customer.setLastName("Schitt");
    customer.setPermissions(new HashSet());
    customer.setAddresses(new HashSet());
   
    CustomerAddress ca = new CustomerAddress();
    ca.setLine1("1");
    ca.setLine2("2");
    ca.setCity("Manchester");
    ca.setPostCode("M1 xx");
   
    customer.getAddresses().add(ca);
   
    Permission p = new Permission();
    p.setPermissionId(1);
   
    customer.getPermissions().add(p);
   
    //customerDao.save(customer);
  }
View Full Code Here

    customer.setFirstName("Jack");
    customer.setLastName("Schitt");
    customer.setPermissions(new HashSet());
    customer.setAddresses(new HashSet());
   
    CustomerAddress ca = new CustomerAddress();
    ca.setLine1("1");
    ca.setLine2("2");
    ca.setCity("Manchester");
    ca.setPostCode("M1 xx");
   
    customer.getAddresses().add(ca);
   
    Permission p = new Permission();
    p.setPermissionId(1);
View Full Code Here

    ca.setCity("Manchester");
    ca.setPostCode("M1 xx");
   
    customer.getAddresses().add(ca);
   
    Permission p = new Permission();
    p.setPermissionId(1);
   
    customer.getPermissions().add(p);
   
    //customerDao.save(customer);
  }
View Full Code Here

   
  private void test() {
    TestDao testDao = (TestDao)context.getBean("testDao");
    List tests = testDao.getAll();
    for (Iterator i = tests.iterator(); i.hasNext();) {
      Test test = (Test)i.next();
      System.out.println(test);
    }
   
    Test test1, test2;
    test1 = testDao.getById(1);
    test2 = testDao.getById(1);
    test1.setName("new Name");
    test2.setName("other name");
    testDao.save(test1);
    testDao.save(test2);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.apress.prospring.ch11.data.TestDao#delete(int)
   */
  public void delete(int testId) {
    Test t = new Test();
    t.setTestId(testId);
    getHibernateTemplate().delete(t);
  }
View Full Code Here

   private StringBuilder currentText = new StringBuilder();
   private Set<String> userIds = Sets.newHashSet();
   private Set<String> groups = Sets.newHashSet();

   public Permission getResult() {
      return new Permission(userIds, groups);
   }
View Full Code Here

   public void testApplyInputStream() {

      InputStream is = getClass().getResourceAsStream(
               "/describe_image_attribute_launchPermission.xml");

      Permission expected = new Permission(Sets.newHashSet("495219933132"), Sets.newHashSet("all"));

      Permission result = factory.create(injector.getInstance(PermissionHandler.class)).parse(is);

      assertEquals(result, expected);
   }
View Full Code Here

   private StringBuilder currentText = new StringBuilder();
   private Set<String> userIds = Sets.newHashSet();
   private Set<String> groups = Sets.newHashSet();

   public Permission getResult() {
      return new Permission(userIds, groups);
   }
View Full Code Here

TOP

Related Classes of com.apress.prospring.ch9.domain.Permission

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.