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() {}
杰森