[jboss-user] [JBoss Eclipse IDE (users)] - javax.persistence.GeneratorType cannot be resolved

ataud do-not-reply at jboss.com
Wed Sep 20 11:21:36 EDT 2006


I install JBossIDE-1.6.0.GA-Bundle-win32 and jboss-4.0.4.GA

I create a new EJB3 project

I create the folowing EntityBean :

----------------------------------------------------------------------------------
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratorType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "COUNTRY")
public class CountryEntity implements Serializable {

	int numCountry;
	String labelCountry;
	String code2Country;
	String code3Country;
	private Collection persons;

	@Id( generate = GeneratorType.AUTO)
	@Column (name = "NUM_COUNTRY")
	public int getNumCountry() {
		return numCountry;
	}
	
	public void setNumCountry(int numCountry) {
		this.numCountry = numCountry;
	}

	@Column (name = "LABEL_COUNTRY")
	public String getLabelCountry() {
		return labelCountry;
	}
	
	public void setLabelCountry(String labelCountry) {
		this.labelCountry = labelCountry;
	}
	
	@Column (name = "CODE2_COUNTRY")
	public String getCode2Country() {
		return code2Country;
	}
	
	public void setCode2Country(String code2Country) {
		this.code2Country = code2Country;
	}
	
	@Column (name = "CODE3_COUNTRY")
	public String getCode3Country() {
		return code2Country;
	}
	
	public void setCode3Country(String code3Country) {
		this.code3Country = code3Country;
	}

	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="country")
	@JoinColumn(name="FK_COUNTRY") // Foreign key in PERSON
	public Collection getPersons() {
		return persons;
	}

	public void setPersons(Collection persons) {
		this.persons = persons;
	}
}
----------------------------------------------------------------------------------

But the Eclipse IDE do not reconise the class javax.persistence.GeneratorType

"The import javax.persistence.GeneratorType cannot be resolved"



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972969#3972969

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972969



More information about the jboss-user mailing list