@@ -0,0 +1,1494 @@
+package com.mysema.query.jpa;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.io.ByteArrayInputStream;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.IOException;%0Aimport java.io.ObjectInputStream;%0Aimport java.io.ObjectOutputStream;%0A%0Aimport org.junit.Test;%0A%0Aimport com.mysema.query.jpa.domain.QCat;%0Aimport com.mysema.query.jpa.impl.JPAQuery;%0Aimport com.mysema.query.types.Expression;%0A%0Apublic class ExpressionSerializationTest %7B%0A%0A    private %3CT%3E T serialize(T obj) throws ClassNotFoundException, IOException %7B%0A        // serialize%0A        ByteArrayOutputStream baos = new ByteArrayOutputStream();%0A        ObjectOutputStream out = new ObjectOutputStream(baos);%0A        out.writeObject(obj);%0A        out.close();%0A%0A        // deserialize%0A        ByteArrayInputStream bain = new ByteArrayInputStream(baos.toByteArray());%0A        ObjectInputStream in = new ObjectInputStream(bain);%0A        T obj2 = (T) in.readObject();%0A        in.close();%0A        return obj2;%0A    %7D%0A%0A    @Test%0A    public void Serialize() throws Exception %7B%0A        //QAdress.adress.name.eq(%22test%22%0A        Expression%3C?%3E expr = QCat.cat.name.eq(%22test%22);%0A        Expression%3C?%3E expr2 = serialize(expr);%0A%0A        assertEquals(expr, expr2);%0A        assertEquals(expr.hashCode(), expr2.hashCode());%0A    %7D%0A%0A    @Test%0A    public void Query() throws ClassNotFoundException, IOException %7B%0A        JPAQuery query = new JPAQuery();%0A        query.from(QCat.cat);%0A        query.where(serialize(QCat.cat.name.eq(%22test%22)));%0A    %7D%0A%0A%7D%0A

Add serialization test #481