JAP映射oracle 表时,因为字段类型是number, 所以生成的对象是BigDECIMAL,如果想类型是:java.util.Long 的话就必须修改配置文件如下:
<sql-type jdbc-type="DECIMAL" hibernate-type="java.lang.Long"></sql-type>
下面是oracle的JDBC-type与数据库字段类型之间的关系。
ARRAY |
BLOB |
Will be read back as BLOB |
BIGINT |
NUMBER(38) |
|
BINARY |
RAW |
Oracle requires the specification of the size for RAW columns. If no size was specified, then 254 is used. Will be read back as VARBINARY |
BIT |
NUMBER(1) |
Oracle has no native boolean type. |
BLOB |
BLOB |
|
BOOLEAN |
NUMBER(1) |
Oracle has no native boolean type. Will be read back as BIT |
CHAR |
CHAR |
|
CLOB |
CLOB |
|
DATALINK |
BLOB |
Will be read back as BLOB |
DATE |
DATE |
|
DECIMAL |
NUMBER |
|
DISTINCT |
BLOB |
Will be read back as BLOB |
DOUBLE |
DOUBLE PRECISION |
|
FLOAT |
FLOAT |
Will be read back as DOUBLE |
INTEGER |
INTEGER |
|
JAVA_OBJECT |
BLOB |
Will be read back as BLOB |
LONGVARBINARY |
BLOB |
Will be read back as BLOB |
LONGVARCHAR |
CLOB |
Will be read back as CLOB |
NULL |
BLOB |
Will be read back as BLOB |
NUMERIC |
NUMBER |
Will be read back as DECIMAL |
OTHER |
BLOB |
Will be read back as BLOB |
REAL |
REAL |
|
REF |
BLOB |
Will be read back as BLOB |
SMALLINT |
NUMBER(5) |
|
STRUCT |
BLOB |
Will be read back as BLOB |
TIME |
DATE |
Will be read back as TIMESTAMP |
TIMESTAMP |
Oracle8 platform: DATE Oracle9/10 platforms: TIMESTAMP |
The TIMESTAMP native type is only supported in Oracle 9 and above. |
TINYINT |
NUMBER(3) |
|
VARBINARY |
RAW |
Oracle requires the specification of the size for RAW columns. If no size was specified, then 254 is |
ARRAY |
BLOB |
Will be read back as BLOB |
BIGINT |
NUMBER(38) |
|
BINARY |
RAW |
Oracle requires the specification of the size for RAW columns. If no size was specified, then 254 is used. Will be read back as VARBINARY |
BIT |
NUMBER(1) |
Oracle has no native boolean type. |
BLOB |
BLOB |
|
BOOLEAN |
NUMBER(1) |
Oracle has no native boolean type. Will be read back as BIT |
CHAR |
CHAR |
|
CLOB |
CLOB |
|
DATALINK |
BLOB |
Will be read back as BLOB |
DATE |
DATE |
|
DECIMAL |
NUMBER |
|
DISTINCT |
BLOB |
Will be read back as BLOB |
DOUBLE |
DOUBLE PRECISION |
|
FLOAT |
FLOAT |
Will be read back as DOUBLE |
INTEGER |
INTEGER |
|
JAVA_OBJECT |
BLOB |
Will be read back as BLOB |
LONGVARBINARY |
BLOB |
Will be read back as BLOB |
LONGVARCHAR |
CLOB |
Will be read back as CLOB |
NULL |
BLOB |
Will be read back as BLOB |
NUMERIC |
NUMBER |
Will be read back as DECIMAL |
OTHER |
BLOB |
Will be read back as BLOB |
REAL |
REAL |
|
REF |
BLOB |
Will be read back as BLOB |
SMALLINT |
NUMBER(5) |
|
STRUCT |
BLOB |
Will be read back as BLOB |
TIME |
DATE |
Will be read back as TIMESTAMP |
TIMESTAMP |
Oracle8 platform: DATE Oracle9/10 platforms: TIMESTAMP |
The TIMESTAMP native type is only supported in Oracle 9 and above. |
TINYINT |
NUMBER(3) |
|
VARBINARY |
RAW |
Oracle requires the specification of the size for RAW columns. If no size was specified, then 254 is |
ARRAY |
BLOB |
Will be read back as BLOB |
BIGINT |
NUMBER(38) |
|
BINARY |
RAW |
Oracle requires the specification of the size for RAW columns. If no size was specified, then 254 is used. Will be read back as VARBINARY |
BIT |
NUMBER(1) |
Oracle has no native boolean type. |
BLOB |
BLOB |
|
BOOLEAN |
NUMBER(1) |
Oracle has no native boolean type. Will be read back as BIT |
CHAR |
CHAR |
|
CLOB |
CLOB |
|
DATALINK |
BLOB |
Will be read back as BLOB |
DATE |
DATE |
|
DECIMAL |
NUMBER |
|
DISTINCT |
BLOB |
Will be read back as BLOB |
DOUBLE |
DOUBLE PRECISION |
|
FLOAT |
FLOAT |
Will be read back as DOUBLE |
INTEGER |
INTEGER |
|
JAVA_OBJECT |
BLOB |
Will be read back as BLOB |
LONGVARBINARY |
BLOB |
Will be read back as BLOB |
LONGVARCHAR |
CLOB |
Will be read back as CLOB |
NULL |
BLOB |
Will be read back as BLOB |
NUMERIC |
NUMBER |
Will be read back as DECIMAL |
OTHER |
BLOB |
Will be read back as BLOB |
REAL |
REAL |
|
REF |
BLOB |
Will be read back as BLOB |
SMALLINT |
NUMBER(5) |
|
STRUCT |
BLOB |
Will be read back as BLOB |
TIME |
DATE |
Will be read back as TIMESTAMP |
TIMESTAMP |
Oracle8 platform: DATE Oracle9/10 platforms: TIMESTAMP |
The TIMESTAMP native type is only supported in Oracle 9 and above. |
TINYINT |
NUMBER(3) |
|
VARBINARY |
RAW |
Oracle requires the specification of the size for RAW columns. If no size was specified, then 254 is |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE hibernate-reverse-engineering
-
SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
-
-
<hibernate-reverse-engineering>
-
-
<type-mapping>
-
-
<sql-type jdbc-type="VARCHAR" length='1' hibernate-type="yes_no"/>
-
-
<sql-type jdbc-type="NUMERIC" precision='1' hibernate-type="boolean"/>
- <!-- the type-mappings are ordered. This mapping will be consulted last,
-
thus overriden by the previous one if precision=1 for the column -->
-
<sql-type jdbc-type="BIGINT" hibernate-type="java.lang.Long"/>
-
<sql-type jdbc-type="INTEGER" hibernate-type="java.lang.Long"/>
-
<sql-type jdbc-type="NUMERIC" hibernate-type="java.lang.Long"/>
-
</type-mapping>
-
-
-
<table-filter match-name="BIN$.*" exclude="true"/>
-
-
-
-
<table-filter match-name="app_user" exclude="true"/>
-
<table-filter match-name="role" exclude="true"/>
-
<table-filter match-name="user_role" exclude="true"/>
-
-
</hibernate-reverse-engineering>
分享到:
相关推荐
JPA用于整合现有的ORM技术,可以简化现有Java EE和Java SE应用对象持久化的开发工作,实现ORM的统一。JPA详解视频教程 第18讲 使用jpa映射单个实体对象.avi
1、基于SpringBoot+Thymeleaf+JPA的博客系统源码.zip 2、该资源包括项目的全部源码,下载可以直接使用! 3、本项目适合作为计算机、数学、电子信息等专业的课程设计、期末大作业和毕设项目,作为参考资料学习借鉴。 ...
drools-persistence-jpa-5.2.0.Final.jar drools
JPA映射关系,多种映射关系的图解,适合EJB初学者,对JPA映射关系的了解.
问题描述 用SpringBoot + Spring Data JPA操作数据库 项目启动的时候 报了一个错 SpringBoot的版本是2.2.6.RELEASE org.springframework.beans.factory.BeanCreationException: Error creating bean with name '...
测试通过,集成了spirng MVC4+data jpa+spring Security pom.xml
仓库管理系统,SpringBoot+Spring Data JPA+.....
作. Java 企.版 5 (Java EE 5) ...使用 JPA .,可以使用批注配置.体的 JPA 行.。批注是一种使用元.据修. Java 源代.的..表. 方法,它...相.的 Java .文件,以便在.行.由 JPA 持.性提供程序解.以管理 JPA 行.。
管理系统系列--仓库管理系统,SpringBoot+Spring Data JPA+.....
java运行依赖jar包
jbpm-persistence-jpa-5.1.0.Final.jar jbpm5
spring-data-jpa-1.3.0.RELEASE.zip
05_JPA详解_日期_枚举等字段类型的JPA映射.zip 05_JPA详解_日期_枚举等字段类型的JPA映射.zip
15_JPA详解_JPA中的联合主键.zip 15_JPA详解_JPA中的联合主键.zip
最基础的JPA编程所需jar文件 附带mysql jar文件,persistence.xml配置文件
spring-data-jpa-1.4.3.RELEASE.jar
jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联映射jpa 关联...