Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » one to one mapping problems
one to one mapping problems [message #605083] Tue, 31 July 2007 02:17
Eclipse UserFriend
Originally posted by: zhshfeng_xx.126.com

in dali tutorial 1.0,there is a problem in onetoone maping.as so:

@OneToOne(targetEntity=com.zsf.test.Address.class)
@JoinColumn(name="ADDR_ID", referencedColumnName = "ADDRESS_ID", table =
"ADDRE", insertable = false, updatable = false)
private String address;

why JPA report "table 'ADDRE' for join column 'ADDR_ID' can not be
resolved "

ADDRE
package com.zsf.test;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Basic;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.AUTO;

@Entity
@Table(name="ADDRE", schema = "ZSF")
public class Address {
@Id
@Column(name="ADDRESS_ID", table = "ADDRE", insertable = false, updatable
= false)
@GeneratedValue(strategy=AUTO)
private long id;
@Basic
@Column(name="COUNTRY", table = "ADDRE")
private String country;
@Basic
@Column(name="CITY", table = "ADDRE")
private String city;
@Basic
@Column(name="PROVINCE", table = "ADDRE")
private String stateOrProvince;
@Basic
@Column(name="STREET", table = "ADDRE")
private String street;
@Basic
@Column(name="P_CODE", table = "ADDRE")
private String postalCode;

public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

public String getCountry() {
return country;
}

public void setCountry(String country) {
this.country = country;
}

public String getCity() {
return city;
}

public void setCity(String city) {
this.city = city;
}

public String getStateOrProvince() {
return stateOrProvince;
}

public void setStateOrProvince(String stateOrProvince) {
this.stateOrProvince = stateOrProvince;
}

public String getStreet() {
return street;
}

public void setStreet(String street) {
this.street = street;
}

public String getPostalCode() {
return postalCode;
}

public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}

}
Previous Topic:New to JPA
Next Topic:NPE when launching JPA Project wizard
Goto Forum:
  


Current Time: Thu Apr 25 09:43:29 GMT 2024

Powered by FUDForum. Page generated in 0.02245 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top