写好了文件,怎么赋值给XML文件呢
写好了方法了,我要和Flex对接,为其提供一个添加的方法,需要配置一个XML文件,请问这个XML文件怎么写才能让Flex端能调用我写的这个添加的方法呢?
Java code?1 import java.util.Date; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.persistence.Query; import org.junit.BeforeClass; import org.junit.Test; import com.rz.openplat.crm.date.entity.PlUserMembergrade; import com.rz.openplat.crm.date.entity.PlUserMembermanage; public class PlUserMembermanageTest1 { @BeforeClass public static void setUpBeforeClass() throws Exception { } @Test public void savePlUserMembermanage() { EntityManagerFactory factory=Persistence.createEntityManagerFactory("myJPA");//-->sessionFactory EntityManager manager=factory.createEntityManager(); //-->session manager.getTransaction().begin();//-->开始事务 PlUserMembermanage ps = new PlUserMembermanage(); //ps.setBrithday(new Date("2012-03-06")); ps.setMembername("天津饭"); ps.setMembersex("女"); ps.setMembertel("13568952369"); ps.setMemberremark("此会员平均一周买一次衣服"); ps.setMembermessage("开启"); //manager.persist(new Person("Hello World"));//new person 是新建状态 manager.persist(ps); manager.getTransaction().commit(); manager.close(); factory.close(); } }
读取和解析XML