-
25 May 2009 11:48 PM #1
BeanModelMarker POJO inheritance
BeanModelMarker POJO inheritance
I have a base class called Identifiable. The Identifiable class has two private fields (Long id, Integer version). Each of my
POJOs extends the Identifiable base class to adhere to Hibernate.
My problem is that when I write a BeanModelMarker like this where MyPojo extends Identifiable:
the 'id' and 'version' fields are always null.Code:@BEAN(MyPojo.class) public interface MyPojoBeanModel extends BeanModelMarker { }
Any clues?
-
25 May 2009 11:56 PM #2
Haven't tried BeanModels in grids, but I noticed the mapping of field names was inconsistent when I tried to reference them via a XTemplate. E.g. I had two fields in two Beans:
while their `stringified' version in the Models ended up to be:Code:private String sPropertyName; private String sFunctionName;
Code:get("propertyname"); get("functionName");
-
26 May 2009 12:30 AM #3
I haven't noticed that when using it with grids. I think that this behavior, the behavior that I'm describing is intentional since the object graph could get crazy big if not careful. I wonder if there is a way to override that behavior and bring up inherited fields as well as defined fields?
-
26 May 2009 6:25 AM #4
Does your Identifiable class have getters and setters for these 2 attributes ?
-
26 May 2009 9:21 PM #5
-
28 May 2009 5:50 PM #6
-
28 May 2009 7:45 PM #7
getId, setId
getVersion, setVersion
...naturally
-
28 May 2009 9:15 PM #8


Reply With Quote
