- 浏览: 216881 次
- 性别:
- 来自: 湖南
文章分类
- 全部博客 (94)
- jQuery实例 (2)
- 数据库篇章 (13)
- Java杂谈 (5)
- SSH技术 (33)
- 工作流 (3)
- ajax技术 (2)
- Web前端 (13)
- Struts2 笔记 (1)
- Struts1 笔记 (0)
- 软件面试题目 (0)
- DWR技术篇章 (4)
- 智力题集 (4)
- 正则表达式 (3)
- C语言经典实例 (10)
- C语言学习 (1)
- ibatis and lucene (2)
- jsp_javascript (5)
- 单个功能模块实现源码 (2)
- jsp网站 (1)
- Linux (1)
- 文件解析 (5)
- 各种分页方法 (3)
- android (0)
- XML 技术 (1)
- HTTP通信 & XML (0)
- springMVC (0)
- 平台框架 (1)
最新评论
-
aiwei:
可不可以解释一下每个参数的意思?看不明白啊
Java 动态加载jsp页面 在div 刷新这么简单 就可以实现了 -
hzau_chen:
:i
很强大的jsp手写分页插件 实现json 等一些ajax技术 联合查询 模糊查询 条件查询 -
yzz9i:
你想怎么操作?这个是可以直接使用的
jsp里面实现 注册成功后 系统自动发送电子邮件 -
Zhang987526341:
我想请问在数据库里面还要加字段什么的吗,
jsp里面实现 注册成功后 系统自动发送电子邮件 -
tlk20071:
我现在要写一个类似的东西,但是一点都不熟悉,你能不能帮忙讲解一 ...
一个简单功能强大的Google Map 搜索源码 【我在CSDN上也有发布】
类对象:
在hibernate 配置文件中添加你的类对象
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.url">jdbc:mysql://localhost:3306/ajaxtest</property>
<property name="connection.username">root</property>
<property name="connection.password">admin</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="myeclipse.connection.profile">mysql</property>
<mapping class="com.pojos.QNEOrder"/>
<mapping class="com.pojos.QNEPassenger"/>
</session-factory>
</hibernate-configuration>
applicationContext.xml 配置文件中:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<context:annotation-config />
<context:component-scan base-package="com.pojos" />
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
</beans>
测试方法:
public class Test1 {
@Test
public void test1() {
Configuration conf=new AnnotationConfiguration().configure();
SchemaExport se=new SchemaExport(conf);
se.create(true, true);
}
}
okl http://yzz9i.iteye.com/blog/1052036
package com.pojos; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * * @author Administrator * */ @Entity @Table(name="sxy_QNEPassenger") public class QNEPassenger { @Id @GeneratedValue private long id; //ID @Column(length=30,nullable=false) private String name; //姓名 @Column(length=30,nullable=false) private int sex; //性别 @Column(length=30,nullable=false) private int type; //类型 @Column(length=30,nullable=false) private String birthDay; //生日 @Column(length=30,nullable=false) private String ticketNum; //票号 @Column(length=30,nullable=false) private String insuranceStatus; //保险状态 private float insurancePrice; //保险价格 @Column(length=30,nullable=false) private String insuranceNum; //保单号 @ManyToOne private QNEOrder order; //订单 public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getSex() { return sex; } public void setSex(int sex) { this.sex = sex; } public int getType() { return type; } public void setType(int type) { this.type = type; } public String getBirthDay() { return birthDay; } public void setBirthDay(String birthDay) { this.birthDay = birthDay; } public String getTicketNum() { return ticketNum; } public void setTicketNum(String ticketNum) { this.ticketNum = ticketNum; } public String getInsuranceStatus() { return insuranceStatus; } public void setInsuranceStatus(String insuranceStatus) { this.insuranceStatus = insuranceStatus; } public float getInsurancePrice() { return insurancePrice; } public void setInsurancePrice(float insurancePrice) { this.insurancePrice = insurancePrice; } public String getInsuranceNum() { return insuranceNum; } public void setInsuranceNum(String insuranceNum) { this.insuranceNum = insuranceNum; } public QNEOrder getOrder() { return order; } public void setOrder(QNEOrder order) { this.order = order; } /******其它信息*******/ }
在hibernate 配置文件中添加你的类对象
引用
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.url">jdbc:mysql://localhost:3306/ajaxtest</property>
<property name="connection.username">root</property>
<property name="connection.password">admin</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="myeclipse.connection.profile">mysql</property>
<mapping class="com.pojos.QNEOrder"/>
<mapping class="com.pojos.QNEPassenger"/>
</session-factory>
</hibernate-configuration>
applicationContext.xml 配置文件中:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<context:annotation-config />
<context:component-scan base-package="com.pojos" />
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
</beans>
引用
测试方法:
引用
public class Test1 {
@Test
public void test1() {
Configuration conf=new AnnotationConfiguration().configure();
SchemaExport se=new SchemaExport(conf);
se.create(true, true);
}
}
okl http://yzz9i.iteye.com/blog/1052036
发表评论
-
Java在项目中怎么让系统运行的更快,其实有好多方法 下面主要写到怎么运用系统级缓存
2012-02-08 17:11 0下面代码就已开发的系统为例子,也给自己学习学习。 ... -
(JAVA)未登录获取系统数据,例如一些公告之类的展示数据
2012-01-14 15:30 900在jsp页面上可以 通过Java代码得到 。 <% ... -
Java 中怎么发送 Email 邮件
2012-01-11 14:47 2540下面是我写的一段发生 ... -
Java 中实现定时服务 在ssh框架中跟普通工程里面创建的方式,区别
2012-01-11 14:33 1150闲话不多说 直接看下面代码 引用 网上这么说的: 1、 S ... -
Java 方便调用的工具类
2012-01-09 19:01 1660//时间格式化 (string型转date型 date转s ... -
Java 里面怎么发送XML数据请求 和怎么处理返回的XML数据
2012-01-04 15:33 0设计了几个关键地方:1 怎么发送请(发送有那些参数,参数怎么处 ... -
创建系统参数 (实例化参数)
2011-12-15 15:45 1149参数文件 引用qnr.properties 之中属性:ex ... -
MySQL存储过程 AND 在JAVA中的程序调用
2011-12-14 11:09 1527一、创建MySQL存储过程示例 下面是具体的创建过程: ... -
Exception in thread "main":com/sun/mail/util/LineInputStream
2011-12-07 16:00 989经过摸索,问题终于解决了。大家 MyEclipse6.5的j ... -
IO 流读取文件时候出现乱码 文件编码格式问题 怎么转换解决方法
2011-11-08 12:18 4465在使用下面这个写法时候UTF-8文件编码 在读取时候出现乱码问 ... -
很强大的jsp手写分页插件 实现json 等一些ajax技术 联合查询 模糊查询 条件查询
2011-10-13 10:02 11113这个插件里面分页功能很强大,调用者只需赋几个值就可以了。 下 ... -
Java 动态加载jsp页面 在div 刷新这么简单 就可以实现了
2011-09-29 17:43 11891引用 <script type="text/j ... -
c:foreach 中jsp页面 中怎么对时间类型进行格式化问题
2011-09-14 12:00 7582具体实现很简单 就两步走: 引用 <%@ taglib ... -
给配置了c3p0的application.xml 配置一个单独的连接文件 applicationContext.xml 数据库连接就不要老是该来改去了
2011-09-09 17:52 2029原本的applicationContext.xml 部分配置( ... -
dao 分页方法
2011-09-01 16:05 1296看看这个类很简单实用: public Map feny ... -
ssh 整合 中怎么使用 c3p0 链接池 经测试已成功 不受 hibernate的8小时限制
2011-08-30 09:44 1365实现方式很简单,只操作 applicationContex ... -
怎么控制 显示 DIV 里面的 字数 只显示部分文字
2011-08-29 09:19 4204在 DIV 里面加如下 样式就可以了。 <div st ... -
FCKeditor 在jsp [ssh 框架中]中怎么调用 实现 图片上传/文件浏览【自己看文档摸索出来的】跟大家一块分享
2011-08-25 14:58 22771:下载 解压FCKeditor_2.6.4.1.zip ... -
使用 过滤器 filter处理session超时问题
2011-08-24 16:11 1475新建一个过滤器命名为:FilterDemo,该类继承自:jav ... -
最好用 最简单的日期时间javascript代码
2011-08-19 16:49 901<script>setInterval(&quo ...
相关推荐
hibernate@注解方式配置实体类时,利用javadoc接口生成数据库表及字段的注释说明,支持oracle、sqlserver、db2、mysql数据库。因用到java\lib\tools.jar,需要将该jar放入工程lib下(或者tomcat\lib下、或加入...
根据SQLServer数据表生成C#实体类,内含SQLHelper,生成工具及源码。可生成数据库图片存储的字段
属性指的类中封装的数据字段;而特性是对类、字段、方法和属性等元素标注的声明性信息 如下代码(Id、Name为User的属性,[DbKey]为Id的特性) /// /// 用户信息 /// public class User { [DbKey] public string...
/// 生成实体类cs文件 /// public static void CreateEntityCode() { using (SqlSugarClient db = CreateDBContext()) { string p = "XT_"; string TABLE_NAME = ""; string COMMENTS = ""; ...
oracle+mysql+sql server 数据库字典表生成,生成表字段,注释,索引等数据库表结构数据。 支持在线化。
Mybatis-generator自动生成代码工具,基于mybatis-generator-core-1.3.7.jar,一键生成数据库表对应的entity、dao、mapper文件,并根据数据库表字段注释生成实体类的中文注释,免去自写mapper、dao、实体类的步骤
把Maticsoft.DbObjects.dll覆盖到动软安装文件夹内即可解决文档中没有备注问题
支持oracle指定表空间生成。 支持批量生成javabean。 支持重写“toString”方法(返回json格式字符串)。 支持国际化。 支持返回字段属性数组。 支持java元注释。 支持生成ibatis配置文件。 支持生成不同文件...
mybatis-generator生成数据库中文注释,非常详细,方便易用
hibernate@注解方式配置实体类时,利用javadoc接口生成数据库表及字段的注释说明,支持oracle、sqlserver、db2、mysql数据库。因用到java\lib\tools.jar,需要将该jar放入工程lib下(或者tomcat\lib下、或引用方式都行...
Oracles数据库表及表字段批量自定义注释,自动注释小工具, 自动注释需要调用百度翻译的通用翻译api,简单注册一个就可以免费用了
mysql或者Oracle通过表注释生成word
一直以来根据数据库表结构自动生成JavaBean、自动生成MyBaits的Mapper映射配置文件、自动生成数据库设计文档都是一件让人很头痛的事情,既浪费时间又很繁琐,看着几十上百个表的成千上万个字段,真是一件让人痛苦的...
读取指定数据库表,生成对应的Java实体类,包含注释,可定义继承类
根据数据库注释自动生成数据库文档【支持Oracle和Mysql】
2、新增快速生成数据库设计文档和批量生成数据库设计文档的功能。 3、新增根据字段快速生成JavaBean的功能,在VO中增量添加字段非常方便。 4、新增精确匹配(排除)和模糊匹配(排除),排除掉不需要生成的表。 5、...
idea配置数据库,反向生成实体类demo,支持lombok,swagger2注解
Mybatis-generator自动生成代码时候提取数据库的字段注释作为实体类字段的jar包
一直以来根据数据库表结构自动生成JavaBean、自动生成MyBaits的Mapper映射配置文件、自动生成数据库设计文档都是一件让人很头痛的事情,既浪费时间又很繁琐,看着几十上百个表的成千上万个字段,真是一件让人痛苦的...
根据generator-mybatis抽取,可配置数据库自动生成实体bean,数据表多的时候非常好用,同时支持生成字段注释,生成的命名规则百度generator mybatis配置就可以根据需求配置