views:

23

answers:

0

I'm trying to use one Named EntityQuery that will allow nulls in the Where clause using '='

Is there a way of setting ANSI_NULLS off or "set ANSI_NULLS off" in JPA the same way as in SQL?

My JBOSS Data source file looks like the following:

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>jdbc/MyDataSource</jndi-name>
    <connection-url>jdbc:oracle:thin:@mydb.com:1521:orcl</connection-url>
    <driver-class>oracle.jdbc.OracleDriver</driver-class>
    <user-name>******</user-name>
    <password>*******</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>5</idle-timeout-minutes>
  </local-tx-datasource>
</datasources>

We're Using a hibernate container for JPA in JBoss 5.1 GA, JDBC is Oracle 10.

Entity query is defined as:

@NamedQuery(name = "Dependent.getDependentFromIndex",
            query = "SELECT d from Dependent d WHERE 
            d.subscriber.ssn = :SubsriberSsn AND 
            " + "d.ssn = :ssn AND 
            d.dateOfBirth = :dateOfBirth AND 
            d.firstName = :firstName")