2014-10-03 56 views

回答

2

没有为数据类型没有这样的“默认”的配置。你需要做一个一个的设置。

如果你想这样做在persistence.xml你需要添加类似代码:

YOUR_PROVIDER

<!-- 
    create a file that will have the mapping, 
    in this case the file name is orm.xml 
--> 
<mapping-file>orm.xml</mapping-file> 

<properties> 
    <!--YOUR PROPERTIES--> 
</properties> 

中包含的代码的代码创建一个文件:

<?xml version="1.0" encoding="UTF-8"?> 
<entity-mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xmlns="http://java.sun.com/xml/ns/persistence/orm" 
       xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" 
       version="1.0"> 

    <entity class="com.uaihebert.model.test.Manufacturer"> 
     <attributes> 
      <basic name="name"> 
       <!--Here you will declare your type--> 
       <column /> 
      </basic> 
     </attributes> 
    </entity> 
</entity-mappings> 
相关问题