예제 #1
0
        public QCandidate ReadSubCandidate(QueryingReadContext context, ITypeHandler4 handler
                                           )
        {
            ObjectID objectID = ObjectID.NotPossible;

            try
            {
                int offset = context.Offset();
                if (handler is IReadsObjectIds)
                {
                    objectID = ((IReadsObjectIds)handler).ReadObjectID(context);
                }
                if (objectID.IsValid())
                {
                    return(new QCandidate(this, null, objectID._id));
                }
                if (objectID == ObjectID.NotPossible)
                {
                    context.Seek(offset);
                    object obj = context.Read(handler);
                    if (obj != null)
                    {
                        QCandidate candidate = new QCandidate(this, obj, context.Container().GetID(context
                                                                                                   .Transaction(), obj));
                        candidate.ClassMetadata(context.Container().ClassMetadataForObject(obj));
                        return(candidate);
                    }
                }
            }
            catch (Exception)
            {
            }
            // FIXME: Catchall
            return(null);
        }