mirror of
https://github.com/apache/openjpa.git
synced 2025-03-09 12:53:52 +00:00
OPENJPA-487: After simplifying SQL generation for LOCATE function, the function works on Firebird 2.1 (wow!).
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1143985 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ff4dc0c5ce
commit
dae5ba7def
@ -384,16 +384,26 @@ public class FirebirdDictionary
|
||||
}
|
||||
|
||||
/**
|
||||
* Throw {@link UnsupportedException}. Firebird in version earlier than 2.1
|
||||
* has no suitable function. Firebird 2.1 has the <code>POSITION</code>
|
||||
* function but using it here results in errors like "data type unknown" or
|
||||
* "expression evaluation not supported".
|
||||
* On Firebird 2.1 return <code>POSITION(<find>, <str> [, <start>])<code>.
|
||||
* On older versions throw {@link UnsupportedException} - no suitable function exists.
|
||||
*/
|
||||
@Override
|
||||
public void indexOf(SQLBuffer buf, FilterValue str, FilterValue find,
|
||||
FilterValue start) {
|
||||
throw new UnsupportedException(_loc.get("function-not-supported",
|
||||
getClass(), "LOCATE"));
|
||||
if (firebirdVersion < FB_VERSION_21) {
|
||||
throw new UnsupportedException(_loc.get("function-not-supported", getClass(), "LOCATE"));
|
||||
}
|
||||
buf.append("POSITION(");
|
||||
find.appendTo(buf);
|
||||
buf.append(", ");
|
||||
str.appendTo(buf);
|
||||
if (start != null) {
|
||||
buf.append(", ");
|
||||
buf.append("CAST(");
|
||||
start.appendTo(buf);
|
||||
buf.append(" AS INTEGER)");
|
||||
}
|
||||
buf.append(")");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -848,11 +848,6 @@ In order to use many of JPQL functions with Firebird 1.5, Interbase UDFs
|
||||
have to be available in the database.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>LOCATE</literal> JPQL function is not supported.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
|
Loading…
x
Reference in New Issue
Block a user