explanation of question
--------------------------
Suppose I have two table like plant and modulo.
In one plant there are number of modules but the tables are not related,please have a look on table.
plant
-----
plant_id Name operator commissioning nominal_power contador installation_id report_id
modulo
--------
module_id power mac ip canid etotal mpp_id
Plant.java
-----------
public class Plant implements Serializable {
private static final long serialVersionUID = 1L;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ2")
@Basic(optional = false)
@NotNull
@Column(name = "PLANT_ID")
private BigDecimal plantId;
@Size(max = 45)
@Column(name = "NAME")
private
String name;
@Size(max = 30)
@Column(name = "OPERATOR")
private String operator;
@Column(name = "COMMISSIONING")
@Temporal(TemporalType.TIMESTAMP)
private Date commissioning;
@Basic(optional = false)
@NotNull
@Column(name = "NOMINAL_POWER")
private double nominalPower;
@Column(name = "CONTADOR")
private BigInteger contador;
@Column(name = "LONGITUDE")
private BigDecimal longitude;
@Column(name = "LATITUDE")
private BigDecimal latitude;
/* here I want something like this private Collection<Modulo> getCollection */
//setters and getters and constructors
}
comments: If it is possible how to do it? otherwise what modification we have to in database. Please help me it's urgent?