db2 « Field « JPA Q&A





1. How do I use Criteria to make a join on a date field (in DB2) based on the year    stackoverflow.com

I have a java.util.Date field in my Object. I would like to use Criteria to select all rows that have a date field with a given year. The SQL ...

2. HQL putting quotes around SMALLINT field - db2 unhappy    forum.hibernate.org

Hibernate 3.3.1 using org.hibernate.dialect.DB2Dialect I have a HQL query generating a WHERE clause with a mapped column of java type "int" and datatype "SMALLINT" in DB2. Looking at the prepared statement inside of Hibernate's AbstractBatcher.class I see that it has placed single quotes around the value (i.e. '11'). DB2 complains with a "SQL0401N The data types of the operands for the ...

3. Error of maxlength of field using DB2    forum.hibernate.org

Hi i am using DB2 as a database for my application. I have come across a problem of maxlength for field name while working with a mainframe the error is The name "MANUAL_ENT_ALLOWED1" is too long. The maximum length is "18". SQLSTATE=42622 This is because i have a field name of 18 char while hibernate internally adds one more char for ...

4. ID generation for DECIMAL fields in DB2    forum.hibernate.org

I'm working on a database that has DECIMAL fields as (currently manually assigned) primary keys. The manual assignment is done as a result of some SQL that just does something like this : SELECT MAX(ID)+1 FROM TABLENAME I want to use hibernate to autogenerate these keys. In the short term I can't change the database to redefine these fields as IDENTITY ...