Invalid ReadAllQuery

We have one Composition relation between Person and Document where Person composits document but while trying to access persons we are getting the follwing error in document query :
Internal Exception: org.postgresql.util.PSQLException: ERROR: syntax error at or near “)”
Position: 314
Error Code: 0
Call: SELECT ID, ASSOCIATED_WITH, AUTHOR, CREATE_TS, CREATED_BY, DELETE_TS, DELETED_BY, DOC_DATE, DOC_NO, DOCUMENT_ID, IS_RECORD, NAME, DOC_TYPE, UPDATE_TS, UPDATED_BY, VERSION, ASSET_ID, ASSOCIATED_ENTITY_ID, ENTITY_ID, LOCATION_ID, PERSON_ID, POSITION_ID, TASK_INSTANCE_ID, FILE_ID FROM ALIGN_DOCUMENT WHERE ((ID IN ()) AND (0=0))
Query: ReadAllQuery(name=“associatedDoc” referenceClass=Document sql=“SELECT ID, ASSOCIATED_WITH, AUTHOR, CREATE_TS, CREATED_BY, DELETE_TS, DELETED_BY, DOC_DATE, DOC_NO, DOCUMENT_ID, IS_RECORD, NAME, DOC_TYPE, UPDATE_TS, UPDATED_BY, VERSION, ASSET_ID, ASSOCIATED_ENTITY_ID, ENTITY_ID, LOCATION_ID, PERSON_ID, POSITION_ID, TASK_INSTANCE_ID, FILE_ID FROM ALIGN_DOCUMENT WHERE ((ID IN ?) AND (0=0))”)

is there anyway to find out how it is generating or whether we can manipulate query generation???