• 大小: 0.92M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-01-21
  • 语言: Java
  • 标签: hibername  

资源简介

,JPA一对一示例 hibername,

资源截图

代码片段和文件信息

// default package

import java.util.logging.Level;
import java.util.logging.Logger;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
/**
 * @author MyEclipse Persistence Tools
 */
public class EntityManagerHelper {

private static final EntityManagerFactory emf; 
private static final ThreadLocal threadLocal;
private static final Logger logger;

static {
emf = Persistence.createEntityManagerFactory(“jpaOne“); 
threadLocal = new ThreadLocal();
logger = Logger.getLogger(“jpaOne“);
logger.setLevel(Level.ALL);
}

public static EntityManager getEntityManager() {
EntityManager manager = threadLocal.get();
if (manager == null || !mana

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        824  2018-01-29 08:40  jpaOne\.classpath

     文件        720  2018-01-29 08:39  jpaOne\.project

     文件        132  2018-01-29 08:41  jpaOne\.settings\com.genuitec.eclipse.persistence.jpa.prefs

     文件        598  2018-01-29 08:36  jpaOne\.settings\org.eclipse.jdt.core.prefs

     文件        136  2018-01-29 08:39  jpaOne\.settings\org.eclipse.jpt.core.prefs

     文件       1485  2018-01-29 08:44  jpaOne\.settings\org.eclipse.jpt.entitygen.me.test.test

     文件        352  2018-01-29 08:40  jpaOne\.settings\org.eclipse.wst.common.project.facet.core.prefs.xml

     文件        223  2018-01-29 08:39  jpaOne\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件       2524  2018-01-29 15:23  jpaOne\bin\EntityManagerHelper.class

     文件       1530  2018-01-29 15:23  jpaOne\bin\Idcard.class

     文件       3955  2018-01-29 15:23  jpaOne\bin\IdcardDAO.class

     文件        600  2018-01-29 15:23  jpaOne\bin\IIdcardDAO.class

     文件        600  2018-01-29 15:23  jpaOne\bin\IPersonDAO.class

     文件        853  2018-01-29 08:41  jpaOne\bin\meta-INF\persistence.xml

     文件       1587  2018-01-29 15:23  jpaOne\bin\Person.class

     文件       3955  2018-01-29 15:23  jpaOne\bin\PersonDAO.class

     文件        990  2018-01-29 15:23  jpaOne\bin\test.class

     文件     999635  2018-01-29 08:39  jpaOne\lib\mysql-connector-java-5.1.44-bin.jar

     文件       1602  2018-01-29 08:41  jpaOne\src\EntityManagerHelper.java

     文件        996  2018-01-29 10:58  jpaOne\src\Idcard.java

     文件       5971  2018-01-29 08:41  jpaOne\src\IdcardDAO.java

     文件       3061  2018-01-29 08:41  jpaOne\src\IIdcardDAO.java

     文件       3039  2018-01-29 08:41  jpaOne\src\IPersonDAO.java

     文件        853  2018-01-29 08:41  jpaOne\src\meta-INF\persistence.xml

     文件       1063  2018-01-29 10:58  jpaOne\src\Person.java

     文件       5949  2018-01-29 08:41  jpaOne\src\PersonDAO.java

     文件        555  2018-01-29 09:47  jpaOne\src\test.java

     目录          0  2018-01-29 15:23  jpaOne\bin\meta-INF

     目录          0  2018-01-29 08:39  jpaOne\src\meta-INF

     目录          0  2018-01-29 08:42  jpaOne\.settings

............此处省略7个文件信息

评论

共有 条评论