Is it possible to mix orm.xml definitions with annotations when using JPA/hibernate ?
        Posted  
        
            by hatchetman82
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by hatchetman82
        
        
        
        Published on 2010-02-01T11:34:01Z
        Indexed on 
            2010/03/22
            4:31 UTC
        
        
        Read the original article
        Hit count: 344
        
I'm working on an application whihc supports using several DB vendors, with the table definitions being different for each DB type. The trouble is that the column definitions are not what hibernate expects, and so my entities contain a lot of @Column(..columnDefintion="..."...) annotations.
To further complicate the issue, there's no way to specify a columnDefinition per DB. So I tried moving just the columnDefinition bits to an orm.xml file, and I have a Maven profile that bundles the correct file.
JBoss 4.0.5/Hibernate 3.2.0GA fails to validate, and it seems it completely disregards the annotations given an xml file.
Is there a way to make Hibernate "merge" the data from the xml with the annotations ?
© Stack Overflow or respective owner