Yes, I've been RTFM'ing the documentation on the SmartGWT EE, Data Integration for CRUD. I have looked at the various options and it seems that for my company needs, the DMI option might be best.
We are using Spring 2.5.x and Hibernate, and we have already created a number of SpringBean DAO's, an example follows below.
Looking at the examples in the EE showcase, it shows the POJO's and DAO's a little differently. If we have to change our existing classes, or add new classes for the DMI/CRUD/SmartGWT EE integration, that shouldn't be a problem.
The Community object is defined as follows:
Thanks!
Tom
We are using Spring 2.5.x and Hibernate, and we have already created a number of SpringBean DAO's, an example follows below.
Looking at the examples in the EE showcase, it shows the POJO's and DAO's a little differently. If we have to change our existing classes, or add new classes for the DMI/CRUD/SmartGWT EE integration, that shouldn't be a problem.
Code:
package com.tom.dao.test; import java.util.List; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; import com.tom.or.test.Community; public class CommunityDaoImpl extends HibernateDaoSupport implements CommunityDao { public List<Community> getCommunity(String communityName) { return (List<Community>)getHibernateTemplate().find(" from com.tom.or.test.Community where communityName = ?", communityName); } public List<Community> getAllCommunities() { return (List<Community>)getHibernateTemplate().find(" from com.tom.or.test.Community"); } public Community getCommunityId(int communityId) { return (Community)this.getHibernateTemplate().get(Community.class, communityId); } }
Code:
package com.tom.or.test; import java.io.Serializable; import java.util.*; import javax.persistence.*; import com.tom.or.test.Data; @Entity(name = "community") public class Community implements Serializable { private int communityID; private String communityName; private Set<Data> data; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "community_id") public int getCommunityID(){ return communityID;} public void setCommunityID(int communityID){this.communityID =communityID;} @Column(name = "community_name") public String getCommunityName(){return communityName;} public void setCommunityName(String communityName){ this.communityName = communityName; } @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER) @JoinColumn(name = "community_id") public Set<Children> getChildren(){ return children; } public void setChildren(Set<Children> children) { this.children = children; } }
Tom
Comment