hibernate配置笔记

手把手教你学Simulink--移动机器人多轮协同场景实例:基于Simulink的双轮差速PMSM轮毂电机协同驱动仿真 本文介绍了基于Simulink的双轮差速PMSM轮毂电机协同驱动仿真系统。针对移动机器人存在的电机参数不一致、负载分配不均等问题,提出主从同步+力矩补偿的协同控制策略。通过搭建包含运动学模型、PMSM电机模型和矢量控制器的仿真系统,实现了速度同步误差<0.005m/s、轨迹跟踪误差<0.8cm、能耗降低12.5%的优化效果。文章详细阐述了建模步骤、核心算法实现和性能验证,为移动机器人动力系统设计提供了实用参考方案。 阅读详情
一个配置的例子:
1.先在数据库中建立一个表cat
create table cat(
cat_id varchar(20) PRIMARY KEY not null,
name varchar(20) not null,
sex char(1))
2.建立hibernate.cfg.xml并生成hibernaetFactory.class管理他
hibernate.cfg.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 2.0//EN"
          " http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration.                   -->
<hibernate-configuration>

    <session-factory>
        <!-- properties -->
        <property name="connection.username">root</property>
        <property name="connection.url">jdbc:mysql://localhost:3306/test</property>
        <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
        <property name="connection.password"></property>
        <property name="connection.driver_class">org.gjt.mm.mysql.Driver</property>

        <!-- mapping files -->
        <mapping resource="com/mdcl/vo/Cat.hbm.xml"/>

    </session-factory>

</hibernate-configuration>
HibernaetFactory.java
package com.mdcl.hibernate;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.Session;
import net.sf.hibernate.cfg.Configuration;

/**
 * Configures and provides access to Hibernate sessions, tied to the
 * current thread of execution.  Follows the Thread Local Session
 * pattern, see {@link http://hibernate.org/42.html}.
 */
public class HibernateFactory {

    /**
     * Location of hibernate.cfg.xml file.
     * NOTICE: Location should be on the classpath as Hibernate uses
     * #resourceAsStream style lookup for its configuration file. That
     * is place the config file in a Java package - the default location
     * is the default Java package.<br><br>
     * Examples: <br>
     * <code>CONFIG_FILE_LOCATION = "/hibernate.conf.xml".
     * CONFIG_FILE_LOCATION = "/com/foo/bar/myhiberstuff.conf.xml".</code>
     */
    private static String CONFIG_FILE_LOCATION = "/hibernate.cfg.xml";

    /** Holds a single instance of Session */
    private static final ThreadLocal threadLocal = new ThreadLocal();

    /** The single instance of hibernate configuration */
    private static final Configuration cfg = new Configuration();

    /** The single instance of hibernate SessionFactory */
    private static net.sf.hibernate.SessionFactory sessionFactory;

    public static Session currentSession() throws HibernateException {
        Session session = (Session) threadLocal.get();
        if (session != null && !session.isOpen()) session = null;
        if (session == null) {
          if (sessionFactory == null) {
            try {
              cfg.configure(CONFIG_FILE_LOCATION);
              sessionFactory = cfg.buildSessionFactory();
            } catch (Exception e) {
              System.err
        .println("%%%% Error Creating HibernateSessionFactory %%%%");
              e.printStackTrace();
            }
          }
          session = sessionFactory.openSession();
          threadLocal.set(session);
        }
        return session;
      }
    public static void closeSession() throws HibernateException {
        Session session = (Session) threadLocal.get();
        threadLocal.set(null);

        if (session != null) {
            session.close();
        }
    }
    private HibernateFactory() {
    }

}
3.建立cat表的po(持久对象),生成cat.cfg.xml,cat.java,AbstractCat.java的过程和上面生成hibernate.cfg.xml和hibernateFactory.java的过程可以由myeclipse协助完成。
cat.cfg.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
                            "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
                            "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration.                   -->
<!-- Created Sat Feb 19 12:00:50 CST 2005                         -->
<hibernate-mapping package="com.mdcl.vo">

    <class name="Cat" table="cat">
        <id name="catId" column="cat_id" type="java.lang.String">
            <generator class="uuid.hex"/>
        </id>
 
        <property name="name" column="name" type="java.lang.String"  not-null="true" />
        <property name="sex" column="sex" type="java.lang.String" />
    </class>
   
</hibernate-mapping>
cat.java

/*
 * Created Thu Feb 17 16:11:44 CST 2005 by MyEclipse Hibernate Tool.
 */
package com.mdcl.vo;

import java.io.Serializable;

/**
 * A class that represents a row in the 'cat' table.
 * This class may be customized as it is never re-generated
 * after being created.
 */
public class Cat extends AbstractCat implements Serializable
{
    /**
     * Simple constructor of Cat instances.
     */
    public Cat()
    {
    }

 /* (non-Javadoc)
  * @see com.mdcl.vo.AbstractCat#getCatId()
  */
 public String getCatId() {
  // TODO Auto-generated method stub
  return super.getCatId();
 }
 /* (non-Javadoc)
  * @see com.mdcl.vo.AbstractCat#getName()
  */
 public String getName() {
  // TODO Auto-generated method stub
  return super.getName();
 }
 /* (non-Javadoc)
  * @see com.mdcl.vo.AbstractCat#getSex()
  */
 public String getSex() {
  // TODO Auto-generated method stub
  return super.getSex();
 }
 /* (non-Javadoc)
  * @see com.mdcl.vo.AbstractCat#getWeight()
  */

 /* (non-Javadoc)
  * @see com.mdcl.vo.AbstractCat#setCatId(java.lang.String)
  */
 public void setCatId(String catId) {
  // TODO Auto-generated method stub
  super.setCatId(catId);
 }
 /* (non-Javadoc)
  * @see com.mdcl.vo.AbstractCat#setName(java.lang.String)
  */
 public void setName(String name) {
  // TODO Auto-generated method stub
  super.setName(name);
 }
 /* (non-Javadoc)
  * @see com.mdcl.vo.AbstractCat#setSex(java.lang.String)
  */
 public void setSex(String sex) {
  // TODO Auto-generated method stub
  super.setSex(sex);
 }
 /* (non-Javadoc)
  * @see com.mdcl.vo.AbstractCat#setWeight(java.lang.Integer)
  */

 /* (non-Javadoc)
  * @see java.lang.Object#hashCode()
  */
 public int hashCode() {
  // TODO Auto-generated method stub
  return super.hashCode();
 }
 /* (non-Javadoc)
  * @see java.lang.Object#finalize()
  */
 protected void finalize() throws Throwable {
  // TODO Auto-generated method stub
  super.finalize();
 }
 /* (non-Javadoc)
  * @see java.lang.Object#clone()
  */
 protected Object clone() throws CloneNotSupportedException {
  // TODO Auto-generated method stub
  return super.clone();
 }
 /* (non-Javadoc)
  * @see java.lang.Object#equals(java.lang.Object)
  */
 public boolean equals(Object obj) {
  // TODO Auto-generated method stub
  return super.equals(obj);
 }
 /* (non-Javadoc)
  * @see java.lang.Object#toString()
  */
 public String toString() {
  // TODO Auto-generated method stub
  return super.toString();
 }
    /**
     * Constructor of Cat instances given a simple primary key.
     * @param catId
     */
    public Cat(java.lang.String catId)
    {
        super();
    }

    /* Add customized code below */

}
AbstractCat.java
/*
 * WARNING: DO NOT EDIT THIS FILE. This is a generated file that is synchronized
 * by MyEclipse Hibernate tool integration.
 *
 * Created Sat Feb 19 12:00:50 CST 2005 by MyEclipse Hibernate Tool.
 */
package com.mdcl.vo;

import java.io.Serializable;

/**
 * A class that represents a row in the cat table.
 * You can customize the behavior of this class by editing the class, {@link Cat()}.
 * WARNING: DO NOT EDIT THIS FILE. This is a generated file that is synchronized * by MyEclipse Hibernate tool integration.
 */
public abstract class AbstractCat
    implements Serializable
{
    /** The cached hash code value for this instance.  Settting to 0 triggers re-calculation. */
    private int hashValue = 0;

    /** The composite primary key value. */
    private java.lang.String catId;

    /** The value of the simple name property. */
    private java.lang.String name;

    /** The value of the simple sex property. */
    private java.lang.String sex;

    /**
     * Simple constructor of AbstractCat instances.
     */
    public AbstractCat()
    {
    }

    /**
     * Constructor of AbstractCat instances given a simple primary key.
     * @param catId
     */
    public AbstractCat(java.lang.String catId)
    {
        this.setCatId(catId);
    }

    /**
     * Return the simple primary key value that identifies this object.
     * @return java.lang.String
     */
    public java.lang.String getCatId()
    {
        return catId;
    }

    /**
     * Set the simple primary key value that identifies this object.
     * @param catId
     */
    public void setCatId(java.lang.String catId)
    {
        this.hashValue = 0;
        this.catId = catId;
    }

    /**
     * Return the value of the name column.
     * @return java.lang.String
     */
    public java.lang.String getName()
    {
        return this.name;
    }

    /**
     * Set the value of the name column.
     * @param name
     */
    public void setName(java.lang.String name)
    {
        this.name = name;
    }

    /**
     * Return the value of the sex column.
     * @return java.lang.String
     */
    public java.lang.String getSex()
    {
        return this.sex;
    }

    /**
     * Set the value of the sex column.
     * @param sex
     */
    public void setSex(java.lang.String sex)
    {
        this.sex = sex;
    }

    /**
     * Implementation of the equals comparison on the basis of equality of the primary key values.
     * @param rhs
     * @return boolean
     */
    public boolean equals(Object rhs)
    {
        if (rhs == null)
            return false;
        if (! (rhs instanceof Cat))
            return false;
        Cat that = (Cat) rhs;
        if (this.getCatId() != null && that.getCatId() != null)
        {
            if (! this.getCatId().equals(that.getCatId()))
            {
                return false;
            }
        }
        return true;
    }

    /**
     * Implementation of the hashCode method conforming to the Bloch pattern with
     * the exception of array properties (these are very unlikely primary key types).
     * @return int
     */
    public int hashCode()
    {
        if (this.hashValue == 0)
        {
            int result = 17;
            int catIdValue = this.getCatId() == null ? 0 : this.getCatId().hashCode();
            result = result * 37 + catIdValue;
            this.hashValue = result;
        }
        return this.hashValue;
    }
}
4.编写一个例子测试一下
servletTest.java
/*
 * Created on 2005-2-19
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.mdcl.test;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.Session;
import net.sf.hibernate.Transaction;

import org.apache.log4j.Logger;

import com.mdcl.hibernate.HibernateFactory;
import com.mdcl.vo.Cat;

/**
 * @author a
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class servletTest extends HttpServlet {

 /**
  * Destruction of the servlet. <br>
  */
 private static Logger log=Logger.getLogger(servletTest.class);
 public void destroy() {
  super.destroy(); // Just puts "destroy" string in log
  // Put your code here
 }

 /**
  * The doGet method of the servlet. <br>
  *
  * This method is called when a form has its tag value method equals to get.
  *
  * @param request the request send by the client to the server
  * @param response the response send by the server to the client
  * @throws ServletException if an error occurred
  * @throws IOException if an error occurred
  */
 public void doGet(HttpServletRequest request, HttpServletResponse response)
   throws ServletException, IOException {
  doPost(request,response);

 }

 /**
  * The doPost method of the servlet. <br>
  *
  * This method is called when a form has its tag value method equals to post.
  *
  * @param request the request send by the client to the server
  * @param response the response send by the server to the client
  * @throws ServletException if an error occurred
  * @throws IOException if an error occurred
  */
 public void doPost(HttpServletRequest request, HttpServletResponse response)
   throws ServletException, IOException {

  response.setContentType("text/html");
  PrintWriter out = response.getWriter();
  out
    .println("<!DOCTYPE HTML PUBLIC /"-//W3C//DTD HTML 4.01 Transitional//EN/">");
  out.println("<HTML>");
  out.println("  <HEAD><TITLE>A Servlet</TITLE></HEAD>");
  out.println("  <BODY>");
  out.print("    This is ");
  out.print(this.getClass());
  try {
   log.info("........servletTest.doPost()....start");
   Session session =HibernateFactory.currentSession();
   Transaction tx = session.beginTransaction();
        Cat cat = new Cat();
        cat.setCatId("4");
        cat.setName("Karl");
        cat.setSex("F");
        session.save(cat);
        tx.commit();
    } catch (HibernateException e) {
         e.printStackTrace();
         log.error("........servletTest.doPost()....error");
       }
  log.debug("start");
  out.println(", using the POST method");
  out.println("  </BODY>");
  out.println("</HTML>");
  out.flush();
  out.close();
  log.info("........servletTest.doPost()....end");
 }

 /**
  * Initialization of the servlet. <br>
  *
  * @throws ServletException if an error occure
  */
 public void init() throws ServletException {
  // Put your code here
 }

}
好了,完成了一次hibernate旅行。不求甚解?
参考由曹晓刚等人翻译的hibernate中文文档
hibernate中文站点http://www.hibernate.org.cn/

扩展卡尔曼滤波 (EKF, Extended Kalman Filter) 算法详解及案例分析 扩展卡尔曼滤波是一种用于估计非线性动态系统状态的递归算法。其目标是通过结合非线性系统模型和观测数据,估计系统的最优状态。 阅读详情

相关推荐

新手必看!用FFmpeg一键合并ts文件的5种方法(含Windows/Mac终端命令)

本文详细介绍了使用FFmpeg合并TS视频文件的5种实用方法,涵盖Windows和Mac终端命令操作。从基础安装到进阶技巧,包括处理音频不同步、批量处理多个视频等场景,帮助用户轻松将m3u8分片视频合并为完整mp4文件,提升视频处理效率。

weixin_29065959的博客 578

VS CODE中使用KoroFileHeader插件设置文件头注释

1 在扩展商店搜索插件“KoroFileHeader”,并安装 2 进入插件设置页面 方法1:在扩展界面,点击插件一栏的设置小图标,点击“扩展设置”进入设置页面 方法2:点击左下角设置按钮,点击“扩展”(ctrl+shift+x快捷键也可调出),找到插件KoroFileHeader进行设置 3 点击setting.json 4 编辑内容(“Do not edit"是系统自动生成的,无需填写) { “fileheader.customMade”: { “Date”:“Do not edit”, “A

weixin_42963678的博客 767

手把手教你用DCA1000和mmWave Studio 2.0采集AWR1843雷达数据(附驱动安装与常见报错排查)

本文详细介绍了使用DCA1000和mmWave Studio 2.0采集AWR1843毫米波雷达数据的全流程指南,包括硬件连接、驱动安装、软件配置及常见报错排查。通过实战经验分享,帮助开发者快速掌握数据采集技巧,优化雷达参数配置,提升数据质量与采集效率。

weixin_30070339的博客 338

Linux Shell 用法(一)3.文件描述符与重定向

一、文件描述符与重定向 编写脚本的时候会频繁用到标准输入(stdin)、标准输出(stdout)和标准错误 (stderr)。脚本可以使用大于号将输出重定向到文件中。命令产生的文本可能是正常输出,也 可能是错误信息。默认情况下,正常输出(stdout)和错误信息(stderr)都会显示在屏幕上。 我们可以分别为其指定特定的文件描述符来区分两者。 文件描述符是与某个打开的文件或数据流相关联的整数。文...

qq_33544833的博客 365

华大HC32F460RS485通信实验

华大HC32F460RS485通信实验

ZhuoWuKeJi的博客 1803

3步搞定专利数据爬取:用Selenium绕过国家知识产权局反爬(附完整代码)

本文详细介绍了3种高效获取专利数据的技术方案,重点解析了使用Selenium绕过国家知识产权局反爬的实战方法,并提供了完整代码示例。文章还探讨了Requests+lxml轻量级方案和混合技术策略,帮助开发者根据需求选择最佳数据爬取方案,特别适合需要专利统计数据的开发者参考。

weixin_29029995的博客 1118

洗礼灵魂,修炼python(67)--爬虫篇—cookielib之爬取需要账户登录验证的网站

学完前面的教程,相信你已经能爬取大部分的网站信息了,但是当你爬的网站多了,你应该会发现一个新问题,有的网站需要登录账户才能看到更多的信息对吧?那么这种网站怎么爬取呢?这些登录数据就是今天要说的——cookie cookie 其实在前面在解析requests模块时也提到过的。 Cookie,指某些网站为了辨别用户身份、进行session跟踪而储存在用户本地终端上的数据(通常经过加密...

weixin_33912246的博客 4888

UE4 - 河流流体插件Fluid Flux

Fluid Flux可以模拟一定区域内的流体效果,由于使用顶视图所Capture的Heightfield信息,所以只支持室外开阔场景,不支持洞穴等室内场景;

GT的虚幻引擎文档 6679

signature=918f469a10f484cd005a7c6a763c1b19,autojs-dev/yarn.lock at master · jingyuexing/autojs-dev ·...

# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.# yarn lockfile v1"@types/body-parser@*":version "1.16.8"resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.16.8....

weixin_33510623的博客 3385

Dify 第 19 篇 手把手教你开发 Dify 插件:从零实现一个时间工具

本文介绍了Dify平台的插件开发机制和流程。Dify支持多种插件类型,包括模型、工具、数据源等,可通过CLI工具快速开发插件。文章详细讲解了如何安装Dify CLI工具,并演示了从零开发一个获取系统时间插件的完整过程,包括项目初始化、文件解读和打包部署。通过该教程,开发者可以快速掌握Dify插件开发的核心要点,实现自定义功能扩展。

甘蓝的专栏 2462

工业缺陷标注要人命?我从零搭了一套自动标注系统,标注效率直接提升10倍

你是不是也深陷工业缺陷标注的无尽内耗?这不是个例,工业视觉项目落地,80%的时间和成本,都耗在了数据标注环节。普通的图像标注(猫狗分类、人脸识别),标注门槛低、规则简单、一致性要求宽松;而工业缺陷标注,是CV领域公认的地狱级难度:缺陷尺寸小到几像素、种类繁杂且非标、行业专业性极强、标注精度要求到像素级、正负样本极度不均衡,人工标注不仅效率低、成本高,更直接决定了模型的最终上限。我在工业视觉行业摸爬滚打了6年,踩遍了人工标注的所有坑,最终从零搭建了一套工业缺陷专用的闭环自动标注系统,把原来一张图30分钟的标注

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 203

urllib库的使用(二)-----python3

代理 from urllib.request import ProxyHandler, build_opener from urllib.error import URLError proxy_handler = ProxyHandler({ 'http':'http://127.0.0.1:9743', 'https':'https://127.1.1.1:9743' }) o...

ingenuou_的博客 243

30. 用GPT-4自动生成测试用例的完整流程

利用GPT - 4生成测试用例面临的主要问题包括:如何准确地将软件需求转化为GPT - 4能够理解的输入提示,以确保生成的测试用例覆盖所有关键功能;如何评估生成的测试用例的有效性和充分性;如何处理生成的测试用例中的错误或不合理之处;以及如何将生成的测试用例集成到现有的测试框架中。

AGI×大数据,开启智能时代的认知跃迁;解码AGI,赋能数据驱动的智能革命。 482

hibernate 配置笔记

hibernate 配置笔记:1。准备工作   下载 hibernate-2.1   hibernate-extensions-2.1.2   Middlegen-Hibernate-r5      apache-ant-1.6.5      设置ANT_HOME ,将%ANT_HOME%/bin追加到环境变量PATH中2。目录结构如下:├─DBdriver(JDBC驱动)├─hibernate-

1576

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

mybatis和hibernate的配置----个人笔记

mybatis: 1.首先,导入spring,mybatis以及工程所需要的其他所有jar包; 2.在web.xml中配置标签加载mybatis和hibernate的配置文件--xml文件; 如:         contextConfigLocation                     classpath*:/config/env/dataAccessContext.x

lianghongwu1991的博客 1053

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

Hibernate学习笔记(1)之主键映射配置

API简介 Configuration   配置:配置文件对象          通过配置文件方式获取: 1)        configure()        2)        configure(String resource):获取指定位置的配置文件(一般不用) 硬编码方式添加映射资源:(两种方式) 1)        addResource(String resource

鹏哥技术博客 448

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Hibernate笔记——C3P0配置

简介 Hibernate作为持久层(ORM)框架,操作数据库,自然也就离不开数据库连接池了。其支持多种连接池,这里就用最熟悉的C3P0连接池。 C3P0连接池前面已经介绍了并使用很多次了就不再详细说明了。 * 一共就两个步骤,首先导入C3P0架包(当然还要有hiberna...

chuanke1344的博客 210

Hibernate学习笔记——主键的配置

Hibernate的ID生成策略有很多种,

ps_zhanglei的专栏 544

孙卫琴的《精通JPA与Hibernate》的读书笔记:配置数据源,由容器提供

在受管理环境中,如JBoss应用服务器,由容器负责构造数据源,即javax.sql.DataSource的实例,然后把它发布为JNDI资源,Hibernate的DataSourceConnectionProviderImpl类充当这个数据源的代理,这个类位于org.hibernate.engine.jdbc.connections.internal包中。 有些Servlet容器,如Tomcat,也能负责构造数据源,并能把它发布为JNDI资源,因此Hibernate也能从Tomcat容器中获得数据源。 以To

csdnuserlala的博客 271

Hibernate学习笔记之EHCache的配置

Hibernate默认二级缓存是不启动的,启动二级缓存(以EHCache为例)需要以下步骤:1、添加相关的包。2、配置hibernate.cfg.xml文件。3、添加配置文件--ehcache.xml。4、配置相关实体的缓存策略。

海洋之心 7496

Hibernate学习笔记:配置hibernate日志

hibernate使用apache的common-logging记录日志,关于log4j的配置不是hibernate学习的主要内容,但是观察日志的活动有利于调试, 查错,了解底层.hibernate提供了详细的日志分类,我的配置文件中基本都提到了它们.#配置根logger,输出到console.##############################################log4

sunxing007的专栏 3823

hibernate配置详解笔记

[-] 一主配置文件hibernatecfgxml二映像配置文件 类名hbmxml位置和对用的类在同一目录下如 一、主配置文件hibernate.cfg.xml 位置:放在src目录下。 主要包含信息: 一、数据库信息    数据库方言(类的全名) 及 数据库链接信息 1.      数据库方言 2.      数据库连接字符串

春夏秋冬 696

java 配置hibernate_javaEE中的hibernate配置笔记

0 从web.xml出发项目中用Spring整合Hibernate,Spring贯穿整个项目,所以先看看Spring在哪一步整合了Hibernate。先看部分web.xml。在context-param设定参数contextConfigLocation。在listener配置基于Web上下文级别的监听器ContextLoaderListener,它会加载contextConfigLocation中...

weixin_35079766的博客 157

【笔记】IntelliJ IDEA配置Hibernate

参考:imooc:http://www.imooc.com/video/7706 1、创建Hibernate的配置文件。 将依赖包导入项目。http://blog.csdn.net/a153375250/article/details/50851049 IntelliJ IDEA配置 Hibernate:https://smiletm.github.io/2016/12/03/...

bangtuo9862的博客 138

Hibernate学习笔记(二)——Hibernate的一些基本配置

一、hibernate.cfg.xml文件的常用配置 hibernate.cfg.xml文件主要用于配置数据库连接和Hibernate运行时所需的各种属性,这个配置文件应该位于应用程序或Web程序的类文件夹 classes中,我们根据上一篇中的示例来简要分析以下这个文件中的一些常用配置。 <!DOCTYPE hibernate-configuration PUBLIC "-//Hiber

记录只为更好地前行 1114
上一篇: Java Reflection (JAVA反射)
下一篇: AOP编程入门--Java篇
sswt
博客等级 码龄24年 1粉丝 57原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值