Hi All,
I got the problem when using the 'Order By' when querying the data,
but if I remove the 'ORDER BY' it will ok.
this is the code that caused the DataStoreNeedException error,
StringBuffer sql = new StringBuffer();
sql.append("select from com.adlink.table.TbMapBanner where")
.append(" map_type=='" + Constant.bannerWebsiteType + "'")
.append(" && map_type_id==" + currentWebsite.getWebsite_id())
.append(" && map_size_name=='"+ tbSize.getSize_name() +"'")
.append(" && ( map_geo=='GLOBAL' " +
" || map_geo=='" + geoCode.getRegionCode() + "'
" +
" || map_geo=='" + geoCode.getCountryCode()+ "'
" +
" || map_geo=='" + geoCode.getStateCode()+ "')
")
.append(" && map_banner_approved==51");
.append(" && map_ratio>=0")
.append(" order by map_ratio DESC")
.append(" range 0,1");
And the Index is:
map_type ▲ , map_type_id ▲ , map_size_name ▲ , map_geo_type ▲ ,
map_geo ▲ , map_account_email ▲ , map_banner_approved ▲ , map_ratio ▼
And for the TbMapBanner code is:
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class TbMapBanner implements Serializable
{
private static final long serialVersionUID = -8895557243942778257L;
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long map_id;
@Persistent
private String map_banner_id;
@Persistent
private String map_size_name;
@Persistent
private String map_type;
@Persistent
private long map_type_id;
@Persistent
private int map_geo_type;
@Persistent
private String map_geo;
@Persistent
private long map_click_count;
@Persistent
private long map_impression_count;
@Persistent
private float map_clickimpratio;
@Persistent
private float map_ratio;
@Persistent
private float map_bid_price;
@Persistent
private int map_sub_map_id;
@Persistent
private int map_banner_approved;
@Persistent
private String map_account_email;
public String getMap_account_email() {
return map_account_email;
}
public void setMap_account_email(String map_account_email) {
this.map_account_email = map_account_email;
}
public float getMap_ratio() {
return map_ratio;
}
public void setMap_ratio(/*float map_ratio*/) {
//this.map_ratio = map_ratio;
this.map_ratio = (map_bid_price/map_clickimpratio);
}
public Long getMap_id() {
return map_id;
}
public void setMap_id(Long map_id) {
this.map_id = map_id;
}
public String getMap_banner_id() {
return map_banner_id;
}
public void setMap_banner_id(String map_banner_id) {
this.map_banner_id = map_banner_id;
}
public String getMap_size_name() {
return map_size_name;
}
public void setMap_size_name(String map_size_name) {
this.map_size_name = map_size_name;
}
public int getMap_banner_approved() {
return map_banner_approved;
}
public void setMap_banner_approved(int map_banner_approved) {
this.map_banner_approved = map_banner_approved;
}
public String getMap_type() {
return map_type;
}
public void setMap_type(String map_type) {
this.map_type = map_type;
}
public long getMap_type_id() {
return map_type_id;
}
public void setMap_type_id(long map_type_id) {
this.map_type_id = map_type_id;
}
public int getMap_geo_type() {
return map_geo_type;
}
public void setMap_geo_type(int map_geo_type) {
this.map_geo_type = map_geo_type;
}
public String getMap_geo() {
return map_geo;
}
public void setMap_geo(String map_geo) {
this.map_geo = map_geo;
}
public long getMap_click_count() {
return map_click_count;
}
public void setMap_click_count(long map_click_count) {
this.map_click_count = map_click_count;
}
public long getMap_impression_count() {
return map_impression_count;
}
public void setMap_impression_count(long map_impression_count) {
this.map_impression_count = map_impression_count;
}
public float getMap_clickimpratio() {
return map_clickimpratio;
}
public void setMap_clickimpratio(float map_clickimpratio) {
this.map_clickimpratio = map_clickimpratio;
}
public float getMap_bid_price() {
return map_bid_price;
}
public void setMap_bid_price(float map_bid_price) {
this.map_bid_price = map_bid_price;
}
public int getMap_sub_map_id() {
return map_sub_map_id;
}
public void setMap_sub_map_id(int map_sub_map_id) {
this.map_sub_map_id = map_sub_map_id;
}
}
anyone can help me, please ?
Thank's
Yohan
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.