0
我有一個類,位置。位置包含定義其邊框的座標列表。將字段映射到OpenJPA中的自定義查詢
@Entity
@Table(name="LOCATION")
public class Location implements Serializable {
private int id;
private List<Coordinates> coordinateList;
// setters and getters w/ mapping annotations
}
coordinateList被映射@OneToMany與保存座標的表。
我想什麼做的就是添加四個字段(或地圖)的位置類:
- maxLat(最大緯度)
- minLat(最低緯度)
- maxLng(等)
- minLng
是否有可能註釋自定義查詢這個領域來填充呢?即
@CustomQueryOrSomething("select max(lat) from Coordinates C where C.location.id = " this.id)
public getMaxLat() {}
傑森