This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

How can I get collection object of one object in another persistence object ?  RSS feed

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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_id Name operator commissioning nominal_power contador installation_id report_id
module_id power mac ip canid etotal mpp_id
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
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ2")
@Basic(optional = false)
@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")
private Date commissioning;
@Basic(optional = false)
@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?
Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
how do I do my own kindle-like thing - without amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!