java - Facing an issue for querying error as "HSQL Database : Unexpected token: END in statement" -


i have created activeobject query below:

ao.find(ip.class, query.select().where("user=? , start>=? , end<=?",u,datefieldl,datefieldl)) 

but gives me below error:

there sql exception thrown active objects library: database: - name:hsql database engine - version:1.8.0 - minor version:8 - major version:1 driver: - name:hsql database engine driver - version:1.8.0 java.sql.sqlexception: unexpected token: end in statement [select * public.ao_0371a8_ip user=? , start>=? , end<=?]

create entity stuff below:

 ip pi = ao.executeintransaction(new transactioncallback() // (1)                 {             @override          public ip dointransaction()          {             logger.info("before ao.create");             ip pi = ao.create(enclass);                                 ....              pi.save();                                           return pi;                    }     }); 

my entity looks below:

@table("ip") @preload     public interface ip extends entity {      @accessor("issues")     string getissues();  @mutator("issues") void setissues(string issues);  @accessor("planstarttime") date getplanstarttime();  @mutator("planstarttime") void setplanstarttime(date planstarttime);  @accessor("planendtime") date getplanendtime();  @mutator("planendtime") void setplanendtime(date planendtime);  @accessor("user") string getuser();  @mutator("user") void setuser(string user); } 

any idea?

unexpected token: end in statement

take @ conditions:

"user=? , start>=? , end<=?" 

end sql keyword (following line of if , begin). change to, example:

"user=? , sessionstarttime>=? , sessionfinishtime<=?" 

the problem here when final sql query generated, has invalid syntax. that's why you're getting exception.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -