就像在一个主题中一样......我如何从一个实体中的数据库中获取相同的字段,但有两种不同的类型......
IE
@Entity
@Table(name = "ROOMS")
public class Rooms implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID_ROOM")
private int idRoom;
@ManyToOne
@JoinColumn(name = "ID_HOTEL")
private Hotel hotel;
//and right here I need a something like
@JoinColumn(name = "ID_HOTEL")
private int hotelId;
但是....我只需要它来使用 EL 进行一些搜索...我不需要它来插入或更新....