Package test

Source Code of test.Launcher

package test;

import jpa.model.obj.FirstEntity;
import jpa.model.obj.SecondEntity;
import jpa.service.OracleTempService;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class Launcher
{
 
  private static final String APPLICATION_CONTEXT = "jpa_hibernate.xml";
  private static ApplicationContext context;
 
  static
  {
    context = new ClassPathXmlApplicationContext(APPLICATION_CONTEXT);
  }
 
  /**
   * @param args
   */
  public static void main(String[] args)
  {
    OracleTempService service = context.getBean(OracleTempService.class);
    for(FirstEntity fe: service.getFirstEntities())
    {
      System.out.println(fe.getProperty());
    }
   
    service.deleteFirstEntityById((byte) 1);
   
    SecondEntity secondEntity = new SecondEntity();
    secondEntity.setProperty("TestProperty");
    secondEntity.setPk((short)22);
    service.persistSecondEntity(secondEntity);
  }

}
TOP

Related Classes of test.Launcher

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.