String « Field « JPA Q&A





1. Trim string field in JPA    stackoverflow.com

I have a db table with column of datatype char(20). I'm not allowed to change it to a varchar. I'm writing a JPA entity mapped to this table. I would like the ...

3. Compare TimeStamp field with String    forum.hibernate.org

GregorianCalendar cal = new GregorianCalendar(); cal.set(GregorianCalendar.YEAR, 2004); cal.set(GregorianCalendar.MONTH, 2); cal.set(GregorianCalendar.DATE, 12); Timestamp ts = new Timestamp(cal.getTime().getTime()); String hqlString = "select myTable.TimeStampField from MyTable as myTable where myTable.TimeStampField = :targetTimeStamp"; Query query = session.createQuery(hqlString); query.setTimestamp("targetTimeStamp",ts); List list = query.list(); ...

4. Automatically truncate String fields on updates?    forum.hibernate.org

To avoid "value too long for column" errors, I would like Hibernate to automatically truncate any string fields before doing an insert or update using the values from the "length" parameter in the field definition of the mapping file of the object. It doesn't seem to be doing this currently...I want to keep the java code auto-generatable, and I'd rather not ...

5. Comparing database fields using Criteria(String matching)    forum.hibernate.org

Hi Friends I need to compare values which are comma separated values present in the database with the user input which is also a comma separated field.I want to compare the individual comma separated fields with the database values and give the result based on that. Help me in this regard.I am using Criteria for this.How to do it.. Thank You ...

7. [Q] 2 dimentional string array as a Field    forum.hibernate.org