Package com.jverstry.Item

Examples of com.jverstry.Item.MilliTimeItem


  private EntityManager em; 
 
  @Override
  public long createMilliTimeItem() {
   
    MilliTimeItem mti = new MilliTimeItem();
    mti.setMilliTime(System.currentTimeMillis());

    em.persist(mti);
    long result = mti.getID();
    em.detach(mti);
   
    return result;
   
  }
View Full Code Here


    private MyService myService;

  @Test
  public void testCreateAndRetrieve() {
   
    MilliTimeItem retr = myService.createAndRetrieve();
   
    assertNotNull(retr);
   
  }
View Full Code Here

    return "index";
  }
 
  @RequestMapping(value="/getJSON", method = RequestMethod.GET)
    public @ResponseBody MilliTimeItem getJSON() {
    return new MilliTimeItem(System.currentTimeMillis());
    }
View Full Code Here

  @Test
  public void testGetMilliTimeItem() {
   
    long id = myDAO.createMilliTimeItem();
    MilliTimeItem retr = myDAO.getMilliTimeItem(id);
   
    assertNotNull(retr);
    assertEquals(id,retr.getID());
   
  }
View Full Code Here

  }
 
    @RequestMapping(value = "/roundtrip")
    public String persistenceStatus(Model model) {
       
    MilliTimeItem retr = myService.createAndRetrieve();
    model.addAttribute("RoundTrip", retr);
   
    return "roundtrip";
   
   
View Full Code Here

 
  @Override
  @Transactional
  public long createMilliTimeItem() {
   
    MilliTimeItem mti = new MilliTimeItem();
    mti.setMilliTime(System.currentTimeMillis());

    em.persist(mti);
    long result = mti.getID();
    em.detach(mti);
   
    return result;
   
  }
View Full Code Here

 
    @RequestMapping(value = "/roundtrip")
    public String persistenceStatus(Model model) {
       
    long id = myService.create();
    MilliTimeItem retr = myService.retrieve(id);
   
    model.addAttribute("RoundTrip", retr);
   
    return "roundtrip";
   
View Full Code Here

TOP

Related Classes of com.jverstry.Item.MilliTimeItem

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.