Запрос на выборку данных: JPA не может прочитать таблицу attributeId.
- выберите запрос для извлечения данных
select r,a from data r ,
Attributes a
where a.attributeId.type != 'test'
and r.typeid = a.attributeId.typeid
and r.deviceid=:deviceid order by r.typeid;
- table1
@Entity
@Table(name = "data")
public class data {
@Id
@Column(name = "typeid")
private Integer typeid;
--- таблица 2
@Entity
@Table(name = "attributes")
public class Attributes implements Serializable {
@EmbeddedId
private Attributeid attributeId;
@Column
private String value;
-Класс с композитными ключами
@Embeddable
public class Attributeid implements Serializable {
@Column
private Integer typeid;
@Column
private String type;
@Column
private String attributename;