Wednesday, 15 April 2015

hibernate - Can I declare mappings in the persistence.xml? -



hibernate - Can I declare mappings in the persistence.xml? -

i declare in persistence.xml file every string type mapped text type. want declare charset type too.

i woudn't declare mapping every single attribute @column...

there no such 'default' configurations datatypes. need set 1 one.

if want in persistence.xml need add together code like:

your_provider

<!-- create file have mapping, in case file name orm.xml --> <mapping-file>orm.xml</mapping-file> <properties> <!--your properties--> </properties>

create file code code below:

<?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 declare type--> <column /> </basic> </attributes> </entity> </entity-mappings>

hibernate jpa hibernate-mapping

No comments:

Post a Comment