3.把hbm转化为DDL有两种方式:第一种是ExportDB,执行ExportDB
来源:互联网 发布:b站雪河炮太捏脸数据 编辑:程序博客网 时间:2024/06/10 10:24
package com.bjpowernode.hibernate;import org.hibernate.cfg.Configuration;import org.hibernate.tool.hbm2ddl.SchemaExport;/** * 将hbm生成ddl * @author Administrator * */public class ExportDB {public static void main(String[] args) {//默认读取hibernate.cfg.xml文件Configuration cfg = new Configuration().configure();SchemaExport export = new SchemaExport(cfg);export.create(true, true);}}
drop table if exists User drop table if exists User2 create table User ( id varchar(255) not null, name varchar(255), password varchar(255), createTime datetime, expireTime datetime, primary key (id) ) create table User2 ( id varchar(255) not null auto_increment, name varchar(255), password varchar(255), createTime datetime, expireTime datetime, primary key (id) )
- 3.把hbm转化为DDL有两种方式:第一种是ExportDB,执行ExportDB
- 1.把hbm转化为DDL有两种方式:第一种是ExportDB,对象,hbm
- 2.把hbm转化为DDL有两种方式:第一种是ExportDB,hibernate.cfg.xml
- 4.把hbm转化为DDL有两种方式:第二种是创建SessionFactory
- 5.把hbm转化为DDL有两种方式:总结
- hibernate-exportDB
- HibernateUtils.java ExportDB.java
- 3.Hibernate首例:把hbm生成ddl
- 2.测试持久化对象的状态:把hbm转化为DDL,Hibernate连接数据库工具类
- 把字符串转化为结合的方式
- 把十进制转化为二进制的一种方法
- 把十进制转化为二进制的一种方法
- UTF8是将Unicode的规定转化为比较省字节的一种存储和传送方式
- 有两种方式构建软件设计:一种是把软件做得很简单以至于明显找不到缺陷;另一种是把它做得很复杂以至于找不到明显的缺陷。
- 把JScript函数模拟为"异步执行"方式
- Hibernate中将Annotation转化为*.hbm.xml的核心实现
- 把Datareader转化为DataTable
- 把JspWrite 转化为 Reader
- 【DP+单调队列】 hdu3415 Max Sum of Max-K-sub-sequence
- 带主体复制环境的数据库迁移
- sqlite数据类型
- cmake并没有想象中好用
- XNA:保存数据到文件和从文件读取数据
- 3.把hbm转化为DDL有两种方式:第一种是ExportDB,执行ExportDB
- using backup controlfile 和 until cancel区别
- 一个比较好面试题 博客----解题笔记
- VML绘图函数封装
- apache+多个tomcat+memcached共享session会话(windows篇)
- 不能打开数据库alter database open
- strtok用法注意
- 第一次使用国内的云服务主机体会
- The Network Adapter could not establish the connection 供应商代码 20(Oracle 11g release2)