Search code examples
hibernatepostgresqljbossglassfish

Operator does not exist: text = bigint


I am trying to get our application that is currently running on glassfish 2.1 to work on jboss 6.1. And have the following problem, I don't think its related to the application server but rather something to do with postgres and /or hibernate.

Using the following software Postgresql 9.0, hibernate 3.6.6 on jboss and 3.2 on glassfish

Anyway, the problem.

this named query:

    @NamedQuery(name="entry.updateDuplicate",
    query="UPDATE entry SET timestamp = :timestamp WHERE username = :username AND searchDocument = :searchDocument")

this code:

    Query query = em.createNamedQuery("Entry.updateDuplicate");
    query.setParameter("timestamp", new Date(System.currentTimeMillis()));
    query.setParameter("username", username);
    query.setParameter("sDocument", sString);

    int affected = query.executeUpdate();

generates this fault in the log:

    10:28:16,149 INFO  [STDOUT] Hibernate: update fu set c_timestamp=? where c_username=? and c_document=?
    10:28:16,165 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: 42883
    10:28:16,165 ERROR [org.hibernate.util.JDBCExceptionReporter] ERROR: operator does not exist: text = bigint
    Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
    Position: 77

the table is this:

    TABLE fu
    (
    id bigint NOT NULL, document text, timestamp timestamp without time zone, username character varying(255), CONSTRAINT fu_pkey PRIMARY KEY (c_id)
    )

Anyone have any idea, to me it seams like it has something to do with 'id' (the only bigInt field) but I can't figure out why or how to begin to solve it.

Any suggestion is most welcome!


Solution

  • The table definition that you posted contains document text, so is searchDocument by any chance a String annotated with @Lob? In that case this might be an issue with the Hibernate version that you're using on JBoss:

    http://www.shredzone.de/cilla/page/299/string-lobs-on-postgresql-with-hibernate-36.html