SriSasken wrote:
I have a few questiond and some suggestions
1. Why do use vectors
Quote:
private Vector collection; // <-- contains VoGenericProductParents
I would suggest to use Set
I will just give an EG
Code:
public class Order implements java.io.Serializable {
private long id;
private Account account;
private Set resources = new HashSet(0);
..................
}
-----
2. And as U said the app is already there, I hope the DB schema is also already there I would recommend to reverse engineer all the entity POJOS and the DAO as well as the DAOimpl from the schema itself.
chec out hibernate tools - reverse engineering .. have to tune template ..
3. If Ur using Spring Framework I would suggest U to extend HbernateDaoSupport which allow U to getHibernateTemplate() which will do away with SessionFactory
Hello and thanks for your reply. I see that I did not write the object structure correctly, it should be:
============================
VoGenericProduct
private
VoGenericProductParentList voGenericProductParentList;
public List getVoGenericProductParentList();
public void setVoGenericProductParentList(VoGenericProductList list);
+ fields...
VoGenericProductParentList (this class is not an derived from Collection)
private Vector collection; // <-- contains VoGenericProductParents
public List getCollection();
public void setCollection();
+ fields...
VoGenericProductParent
A lot of fields and properties (see Hibernate mapping files below).
============================
The problem is that VoGenericProductParentList is not a subclass of Collection - but it has a property called collection that is a Vector. Unfortunately I have to live with this setup since the code is generated.
The problem is that I don't really know how to map the relationship. The basic structure is that each VoGenericProduct has many VoGenericProductParents. The relation in the code, though, is that each VoGenericProduct has a VoGenericProductList which has a collection (Vector) containing VoGenericProductParents. The VoGenericProductList may seem like a stupid implementation but as said before, I cannot do anything about it...
Yes, the tables do exist in the database.
Best regards,
Simon