Ejemplo n.º 1
0
        public override void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect
                                   , ByteArrayBuffer writer)
        {
            writer.WriteShortString(trans, aspect.GetName());
            if (!(aspect is FieldMetadata))
            {
                return;
            }
            FieldMetadata field = (FieldMetadata)aspect;

            field.Alive();
            if (field.IsVirtual())
            {
                return;
            }
            ITypeHandler4 handler = field.GetHandler();

            if (handler is StandardReferenceTypeHandler)
            {
                // TODO: ensure there is a test case, to make this happen
                if (((StandardReferenceTypeHandler)handler).ClassMetadata().GetID() == 0)
                {
                    trans.Container().NeedsUpdate(clazz);
                }
            }
            writer.WriteInt(field.FieldTypeID());
            BitMap4 bitmap = new BitMap4(3);

            bitmap.Set(0, field.IsPrimitive());
            bitmap.Set(1, Handlers4.HandlesArray(handler));
            bitmap.Set(2, Handlers4.HandlesMultidimensionalArray(handler));
            // keep the order
            writer.WriteByte(bitmap.GetByte(0));
        }
Ejemplo n.º 2
0
 private FieldMetadata FieldMetadataFrom(QField qField, Db4objects.Db4o.Internal.ClassMetadata
     type)
 {
     FieldMetadata existingField = qField.GetFieldMetadata();
     if (existingField != null)
     {
         return existingField;
     }
     FieldMetadata field = type.FieldMetadataForName(qField.Name());
     if (field != null)
     {
         field.Alive();
     }
     return field;
 }
Ejemplo n.º 3
0
 public QField(Transaction a_trans, string name, FieldMetadata fieldMetadata, int
               classMetadataID, int a_index)
 {
     // C/S only
     i_trans           = a_trans;
     i_name            = name;
     _fieldMetadata    = fieldMetadata;
     i_classMetadataID = classMetadataID;
     _fieldHandle      = a_index;
     if (_fieldMetadata != null)
     {
         if (!_fieldMetadata.Alive())
         {
             _fieldMetadata = null;
         }
     }
 }
Ejemplo n.º 4
0
 public QField(Transaction a_trans, string name, FieldMetadata fieldMetadata, int
     classMetadataID, int a_index)
 {
     // C/S only	
     i_trans = a_trans;
     i_name = name;
     _fieldMetadata = fieldMetadata;
     i_classMetadataID = classMetadataID;
     _fieldHandle = a_index;
     if (_fieldMetadata != null)
     {
         if (!_fieldMetadata.Alive())
         {
             _fieldMetadata = null;
         }
     }
 }