Why is Hibernate not loading a column?

Posted by B.R. on Stack Overflow See other posts from Stack Overflow or by B.R.
Published on 2011-01-08T15:44:13Z Indexed on 2011/01/08 15:54 UTC
Read the original article Hit count: 125

Filed under:
|

I've got an entity with a few properties that gets used a lot in my Hibernate/GWT app. For the most part, everything works fine, but Hibernate refuses to load one of the properties. It doesn't appear in the query, despite being annotated correctly in the entity.

The relevant portion of the entity:

@Column(name="HasSubSlots")
@Type(type="yes_no")
public boolean hasSubSlotSupport() {
   return hasSubSlotSupport;
}

And the generated SQL query:

Hibernate: 
    /* load entities.DeviceModel */ select
        devicemode0_.DevModel as DevModel1_0_,
        devicemode0_.InvModelName as InvModel2_1_0_ 
    from
        DeviceModels devicemode0_ 
    where
        devicemode0_.DevModel=?

Despite the fact that I refer to that property, it's never loaded, lazily or not, and the getter always returns false. Any ideas on how I can dig deeper into this, or what might be wrong?

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate