2010-12-08 27 views
3

J'ai utilisé avec succès le type personnalisé hibernate avec hibernation et printemps. Nous utilisons maintenant JPA pour les nouvelles entités et espérons que Hibernate pourra toujours prendre en charge les anciens fichiers hbm dont le type personnalisé est défini. Cependant, j'ai la même exception. Tous nos anciens mappages d'hibernation sont externalisés mais de nouvelles entités JPA utilisent des annotations. Toute aide est appréciée. thxjpa 2 et hiberner ensemble + hiberner types personnalisés + printemps

Erreur: Impossible de déterminer le type pour: com.equifax.aspire.persistence.framework.hibernate.EmptySupportedString

<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/> 

    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> 
    <property name="persistenceXmlLocation" value="classpath:/persistence.xml"/> 
    <property name="dataSource" ref="root.platform.persistence.dataSource"/> 
    <property name="jpaVendorAdapter"> 
     <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> 
     <property name="showSql" value="true"/>  
     <property name="database" value="ORACLE"/> 
     <property name="databasePlatform" value="org.hibernate.dialect.OracleDialect" />   
     </bean> 
    </property> 
    <!--<property name="loadTimeWeaver"> 
     <bean class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver"/> 
    </property> --> 
    </bean> 

Mon mappage de type personnalisé dans le fichier HBM

<property name="securityCode" column="SecurityCode" type="com.persistence.framework.hibernate.EmptySupportedString"/> 
+0

toute aide à ce sujet? –

Répondre

2

Vous pouvez ajouter le fichier .hbm.xml au fichier persistence.xml. Comme si:

<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"> 
    <persistence-unit name="name"> 
     <provider>org.hibernate.ejb.HibernatePersistence</provider> 
     <mapping-file>com/equifax/aspire/persistence/framework/hibernate/EmptySupportedString.hbm.xml</mapping-file> 

Cela devrait le rendre disponible