I'm facing similar issue now.
Environment : Sybase database , Open JPA 1.1.0

I'm using Native names queries.
and Entity mapping is also done in orm.xml file, but not Annotations.

I've tried following:
<named-native-query name="testEnum1"
result-class="com.proj.test.ojpa.TaskCode">
        <query>
        <![CDATA[ 
        SELECT m.nbr_mrtg_fm as loanId, m.dt_fund as myDate,
        case when mc.code_chartc in ('RECAST') 
             then 'Recast'       
             else null  
        end as codePurpose
        from mrtg m 
        left outer join mrtg_chartc  mc         
            on  m.id_mrtg = mc.id_mrtg 
            and mc.dt_eff_end  is null 
            and mc.code_chartc in ('LTF','RECAST') 
        WHERE m.dt_fund between '01/01/2010' and '01/08/2010'
        ]]>
        </query>
</named-native-query>
        
        
<entity class="com.proj.test.ojpa.TaskCode">
        <table name="mrtg" />
        <attributes>
                <id name="loanId"></id>
                <basic name="myDate">
                        <temporal>DATE</temporal>
                </basic>
                <basic name="codePurpose" fetch="EAGER" optional="true">        
                        
                        <enumerated>STRING</enumerated>
                </basic>
        </attributes>
</entity>

Where am I doing wrong??
Thanks



-- 
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-MySQL-Environment-NamedQuery-always-returns-null-for-Enumerated-column-types-tp216529p5967959.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Reply via email to