How to write couch base query into java


I would like to translate below N1QL query into java code using couch base select statements

select * from Table_Name where STR_TO_MILLIS(DateTime_ColomnName) <= DATE_ADD_MILLIS(NOW_MILLIS(), -2, ‘hour’)

I would really appreciated if somebody can guid me.

Thanks in advance!

check out Couchbase Native to Java N1QL Query

I am able to translate into Java code. Here is the solution

Statement"*").from(i(“Table_Name”)).where(x("ColumnName ").eq(s(ColumnName))
.and(x("ColumnName ").eq(s(“ColumnName”))) .and(strToMillis(“DateTImeColumnName”).lte(dateAddMillis(nowMillis(),-200,DatePart.hour))))