I have a custom row reader able to initialize materialized objects by their _postinit() methods. Essentially it works, but there is a problem - the _postinit() should be called after the object is materialized completely, i.e. with all fields, but also references and collections filled. So, I guess I have to override some other method of rowreader or something completely different - please, give a hint.

public class RowReaderPostinitializingImpl extends RowReaderDefaultImpl
{
    public RowReaderPostinitializingImpl(ClassDescriptor c)
    {
        super(c);
    }

    public Object readObjectFrom(Map row)
    {
        Object result = super.readObjectFrom(row);
        if (result instanceof Postinitializable)
        {
            Postinitializable art = (Postinitializable) result;
            art._postinit();
            return art;
        }
        else
        {
            return result;
        }
    }
}

David

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to