nullable « Field « JPA Q&A





1. Problem with nullable enum fields + Hibernate 3    coderanch.com

Hi, I am using following combinations for my application 1) Hibernate 3 2) MySQL 5.0.15-standard And I am facing a problem when i select row (using findObjects) from table that has enum field and value of that field is null. I understand that enum field should be not-null in database,but if its nullable why hiberate throws following error ? Is this ...

2. Taking care of Non-Nullable Fields in update()    forum.hibernate.org

I am using the Update method of Hibernate to update a certain row. I created my tablebean, populated it with the primary key, and then the secondary fields I want to change, and then executed the update: TableBeanT newT = new TableBeanT(); newT.setID(..); // primary key newT.setField1(..); // my update getHibernateTemplate().update(newT); The table also has some non-null columns. I didn't populate ...

3. nullable persistent field    forum.hibernate.org

4. Nullable fields in criteria retrieves no value    forum.hibernate.org

Hi there, I've got the following problem: When I'm making a query using 'Criteria' and 'Restrictions', some objects are not retrieved at all , when a criteria field is null. For example: in a table EMPLOYEE (name, age, salary), I want to select an emplyee called 'Jean' (who exists), but 'salary' is null. ----- List emps = session.createCriteria(Employee.class) .add( Restrictions.eq("name",) ) ...

5. Primitive field for nullable column    forum.hibernate.org

Hi, I have a boolean field in the Java class that I want to map to a nullable numeric column (whose value would be 0 or 1). Hibernate does not allow primitive types to be mapped to nullable columns. I use the default setting in Hibernate where the fields are accessed as properties, i.e. by settters and getters. So, I want ...