EJB-QL does not support the comparison of Objects. JBossQL does support this, but you most likely will not get the results you expect. Since the comparison happens in the database server the database is complaint the bytes of the serialize object. The real problem is if you serialize an object twice with the same value, you are not guaranteed to get the same bytes. So you can do it, but it probably won't work.