Hello,
Need help !! lol
I have to code an application with Struts and Hibernate. There are the Products and the Customers.
In the Product form, there are groups of multiboxes to specify :
reasons to release the product
caracteristics it has , which makes the product an innovation if it is a machin or a container or other
benefices for environment it can do
benefices for ... and so on
The Class Product of the Model Layer is the following one :
Code:
public class Produit
{
public Produit(){}
private long id;
private String nomFr;
private String nomAng;
private Date dateLancement;
private String typeLancement;
private List<String> raisonsLancement;
private String domaineApplication;
private List<String> caracteresInnovantsContenant;
private List<String> caracteresInnovantsMachine;
private List<String> caracteresInnovantsAutres;
private List<String> beneficesSur;
private List<String> beneficesPratique;
private List<String> beneficesRentable;
private List<String> beneficesEcoCitoyen;
private List<String> beneficesDifferent;
private String descriptifFr;
private String descriptifAng;
private boolean hasPhoto;
private Client client;
/* getters/setters */
}
I know sorry it's in French :)
but globally, I have many properties which are Arrays of String.
As far as the Class Customer is concerned, it's classical (property like id, firstname, lastname ...). A Customer can have many Products and A product is owned by only one customer.
I have to do the mapping by using the annotations.
So a customer will have a Set of product
Then in the class Customer, we'll have annotations such as :
@OneToMany(cascade = CascadeType.ALL)
private List<Produit> produits = new ArrayList<Produit>();
..and so on
so no problem for the Class Customer.
The problem now is I was wondering
how to do the mapping of the class Product because it's the first time I do the mapping of a class which has
String Arrays as properties. I dunno how to do it (what annotation I have to use ...)and I was also wondering what it will look like physically in the database with such Classes. The table "Product" will have an foreign key references by the "Customer", but what about the String Arrays in the table "Product"...
Please help me ! Any help will be appreciate ;)