|
I use postgreSQL 7.1 and castor 0.9.3. In the
database the fields that are floats are 'float8'. How do I work around the
following error:
Error
Message:
you will have to retype this query using an
explicit cast
Stack Trace follows: java.sql.SQLException: ERROR: Unable to
identify an operator '=' for types 'float8' and 'numeric'
You will have to retype this query using an explicit cast at
org.postgresql.Connection.ExecSQL(Connection.java:533)
at
org.postgresql.jdbc2.Statement.execute(Statement.java:294)
at
org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:78)
at
org.postgresql.jdbc2.PreparedStatement.executeUpdate(PreparedStatement.java:122)
at
org.exolab.castor.jdo.engine.SQLEngine.store(SQLEngine.java:849)
at
org.exolab.castor.persist.ClassMolder.store(ClassMolder.java:1544)
at
org.exolab.castor.persist.LockEngine.store(LockEngine.java:745)
at
org.exolab.castor.persist.TransactionContext.prepare(TransactionContext.java:1162)
at
org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java:498)
at
com.radiovoodoo.datamodule.entities.SongService.findByPrimaryKey(SongService.java:94)
at
_jsp._localhost_23a7575_0._services._song_0uploader._setsong__jsp._jspService(_setsong__jsp.java:72)
at
com.caucho.jsp.JavaPage.service(JavaPage.java:87)
at
com.caucho.jsp.JavaPage.subservice(JavaPage.java:81)
at
com.caucho.jsp.Page.service(Page.java:407)
at
com.caucho.server.http.Invocation.service(Invocation.java:290)
at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:238)
at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:157)
at
com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at
java.lang.Thread.run(Thread.java:484)
Query:
SELECT r FROM
com.radiovoodoo.station.Song r WHERE r.songId=$1
Mapping:
<!-- Mapping for song
-->
<class name="com.radiovoodoo.station.Song" identity="songId" >
<description>Song</description>
<map-to table="song" xml="song" /> <field name="songId" type="java.lang.Integer" > <sql name="song_id" type="integer"/> <xml node="attribute"/> </field> <field name="fullSongPath" type="string" > <sql name="fullsong_path" type="varchar"/> <xml node="attribute"/> </field> <field name="snippetPath" type="string" > <sql name="snippet_path" type="varchar"/> <xml node="attribute"/> </field> <field
name="fullSecondsLength" type="java.lang.Float"
>
<sql name="fullsong_seconds_length" type="float"/> <xml node="attribute"/> </field> <field
name="snippetSecondsLength" type="java.lang.Float"
>
<sql name="snippet_seconds_length" type="float"/> <xml node="attribute"/> </field> <field name="genre"
type="string"
>
<sql name="genre" type="varchar"/> <xml node="attribute"/> </field> <field name="album"
type="string"
>
<sql name="album" type="varchar"/> <xml node="attribute"/> </field> <field name="artist"
type="string"
>
<sql name="artist" type="varchar"/> <xml node="attribute"/> </field> <field name="title"
type="string"
>
<sql name="title" type="varchar"/> <xml node="attribute"/> </field> <field name="mood" type="string" > <sql name="mood" type="varchar"/> <xml node="attribute"/> </field> <field name="uploadDate"
type="java.util.Date"
>
<sql name="upload_date" type="date"/> <xml node="attribute"/> </field> <field name="songCode1"
type="java.lang.Integer"
>
<sql name="song_code1" type="integer"/> <xml node="attribute"/> </field> <field name="songCode2"
type="java.lang.Integer"
>
<sql name="song_code2" type="integer"/> <xml node="attribute"/> </field> <field name="songCode3"
type="java.lang.Integer"
>
<sql name="song_code3" type="integer"/> <xml node="attribute"/> </field> </class>
thanks,
--heather grace
|
