That is my case, a legacy system... cant change database.
(Correction: there is a PK-FK relationship between the tables, sorry)
Stops:
- stopID NOTNULL primarykey
- code NOTNULL foreignkey
- thingA NOTNULL
- thingB NOTNULL
- othersThings
Problems:
- code NOTNULL primarykey
- description
- thing1 NOTNULL
- thing2 NOTNULL
i want to map a class like:
Code:
package testPackage;
public class Stop {
private String code;
private String thingA;
private String thingB;
private String otherThings;
private String description;
...
//gets and sets
}
the only thing coming from the 'Problems' table is the 'description' that matches the 'code'.
in my case i only want to read this information from the database, never updates, inserts...etc.
do i need to map the stopID too?
Quote:
"You need to create a unique key on the first class with the two columns which are being referred in the second table."
can you show me a example?
Quote:
"Then in the second class you would need to use property-ref to the unique key on the first class. "
can this be done with only one class like the one above?
thanks.
Andre