Package examples.entity

Examples of examples.entity.JeecgDemo


public class ClientService {
  public static void main(String args[]) {
    BeanFactory factory = new ClassPathXmlApplicationContext("applicationContext.xml");
    JeecgDemoService jeecgDemoService = (JeecgDemoService) factory.getBean("jeecgDemoService");
    JeecgDemo jeecgDemo = new JeecgDemo();
    jeecgDemo.setAge(30);
    jeecgDemo.setBirthday(new Date());
    jeecgDemo.setUserName("张代浩111");
    jeecgDemoService.add(jeecgDemo);
   
  }
View Full Code Here


  String  id = "402880e740a622870140a6228ac00000";
 
 
  @Test
  public void testInsert() {
    JeecgDemo jeecgDemo = new JeecgDemo();
    jeecgDemo.setAge(30);
    jeecgDemo.setBirthday(new Date());
    jeecgDemo.setUserName("张代浩111");
    jeecgDemoDao.saveByHiber(jeecgDemo);
    id = jeecgDemo.getId();
  }
View Full Code Here

    id = jeecgDemo.getId();
  }

  //@Test
  public void testUpdate() {
    JeecgDemo jeecgDemo = new JeecgDemo();
    jeecgDemo.setId(id);
    jeecgDemo.setAge(90);
    jeecgDemo.setBirthday(new Date());
    jeecgDemo.setUserName("李四");
    jeecgDemoDao.updateByHiber(jeecgDemo);
  }
View Full Code Here

  }


  //@Test
  public void testGetEntity() {
    JeecgDemo jeecgDemo = jeecgDemoDao.getByIdHiber(JeecgDemo.class,id);
    if(jeecgDemo!=null){
      logger.info("-------------testGetEntity() -------------"+jeecgDemo.getAge()+"       "+jeecgDemo.getUserName());
    }
  }
View Full Code Here

    }
  }

  //@Test
  public void testDelete() {
    JeecgDemo jeecgDemo = new JeecgDemo();
    //删除必须带上ID
    jeecgDemo.setId(id);
    jeecgDemoDao.deleteByHiber(jeecgDemo);
  }
View Full Code Here

  }
 

  @Test
  public void testListAll() {
    JeecgDemo jeecgDemo = new JeecgDemo();
    List<JeecgDemo> list = jeecgDemoDao.listByHiber(jeecgDemo);
    for(JeecgDemo po:list){
      logger.info(po.getUserName());
    }
  }
View Full Code Here

TOP

Related Classes of examples.entity.JeecgDemo

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.