on 04-23-2008 10:22 PM
Hello,
based on the Employee example of the book JAVA Programming with SAP Netweaver I try to develop the referenceapplication with a little modified context.
I use a table for cars instead for employees and created the following source code. My Problem is that all annotation like @Entity, @Table or @ID are highlightes as - @Entity/@Table/@ID cannot be resolved to a type.
Is there a problem with the package? If I try to Add imports over the contextmenue nothing happens.
But I know I should normaly import the javax.persistence.* package.
Is it necessary to install the javax.persistece packages manualy?????
Code:
package com.sap.demo;
import java.io.Serializable;
@Entity
@Table(name="TMP_Cars")
@TableGenerator(name="idGenerator", table="TMP_ID_GEN",
pkColumnName="GEN_Key", valueColumnName="GEN_VALUE")
public class Cars implements Serializable {
@ID
@GeneratedValue (strategy=GenerationType.Table,
generator="idGenerator")
private static final long serialVersionUID = 111L;
@Column(name="ID")
private long carId;
@Column(name="Manufacturer")
private String manufacturer;
@Column (name="Model")
private String model;
@Version
private int version;
public Cars() {
// TODO Auto-generated constructor stub
}
public long getCarId() {
return carId;
}
public void setCarId(long carId) {
this.carId = carId;
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
}
Hi, Marco,
If you are using the SAP NetWeaver Developer Studio, you simply right-click on the entity code and choose Source >> Organize Imports
Hope that helps!
Regards,
Yordan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.