I'm trying to set up 2 ListGrids that show one-to-many parent/child data. I think I've followed all of the documentation correctly, however there are no related records being returned in the fetch, the list of related records is null.
Here's my parent data source:
The child data source:
Parent/child classes (getters and setters omitted for brevity):
Here's what I'm getting in the RPC fetch:
Is there something I'm doing wrong with my data sources?
Here's my parent data source:
Code:
<DataSource ID="BuildingType" serverType="hibernate" dropExtraFields="true" sendExtraFields="false" beanClassName="com.assaabloy.aaos.shared.entities.ads.BuildingType" configBean="adsSessionFactory"> <fields> <field name="id" type="sequence" hidden="true" primaryKey="true"/> <field name="locale" type="text" hidden="true" required="true"/> <field name="productName" type="text" length="100" required="true"/> <field name="alternatePicture" type="text" length="100" required="false"/> <field name="briefDesc" type="text" title="Brief Description" length="100" required="false"/> <field name="keyWords" type="text" required="false"/> <field name="revitTypes" type="text" length="800" required="false"/> <field name="aaosTypes" type="text" length="800" required="false"/> <field name="sortOrder" type="integer" required="true"/> <field name="projectTypeList" multiple="true" type="AAOSProjectType" foreignKey="AAOSProjectType.id"/> </fields> </DataSource>
Code:
<DataSource ID="AAOSProjectType" serverType="hibernate" beanClassName="com.assaabloy.aaos.shared.entities.ads.AAOSProjectType" configBean="adsSessionFactory"> <fields> <field name="id" type="sequence" hidden="true" primaryKey="true"/> <field name="locale" type="text" hidden="true" required="true"/> <field name="name" type="text" length="100" required="true"/> </fields> </DataSource>
Code:
@Entity @XmlRootElement public class BuildingType implements Serializable { private static final long serialVersionUID = 1L; private Integer sortOrder; @Column(length = 100) private String productName; @Column(length = 100) private String alternatePicture; @Column(length = 2147483647) private String briefDesc; @Column(length = 2147483647) private String fullDesc; @Lob private byte[] image; @Column(length = 2147483647) private String keyWords; private Boolean hide; @Column(length = 800) private String revitTypes; @Column(length = 800) private String aAOSTypes; @Column(length = 10) private String locale; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(nullable = false) private Integer id; @OneToMany(mappedBy = "marketSegmentID") private List<AAOSProjectType> projectTypeList; /** Getters and setters **/ }
Code:
@Entity @XmlRootElement public class AAOSProjectType implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(nullable = false) private Integer id; @Column(length = 100) private String name; @Column(length = 200) private String description; @Column(length = 2147483647) private String definition; @Column(length = 10) private String locale; @JoinColumn(name = "MarketSegmentID", referencedColumnName = "ID") @ManyToOne private BuildingType marketSegmentID; /** Getters and setters **/ }
Code:
{ affectedRows:0, data:[ { projectTypeList:null, keyWords:"RES\\", aaosTypes:"Apartments/Condominiums 1-3 Stories|Apartments/Condominiums 4+ Stories|", locale:"en_US", productName:"Apartments/Condominiums", briefDesc:null, sortOrder:1, alternatePicture:"None", id:1, revitTypes:"Multi Family|Single Family|" }, { projectTypeList:null, keyWords:null, aaosTypes:null, locale:"en_GB", productName:"Residential", briefDesc:null, sortOrder:1, alternatePicture:null, id:101, revitTypes:null }, ...
Comment