示例#1
0
 internal PropertyType(bool isVertexProp, TypeId typeId, PropertyId propertyId, string name, Graph graph)
 {
     m_typeId           = typeId;
     m_isVertexProperty = isVertexProp;
     m_propertyId       = propertyId;
     m_propertyName     = name;
     m_graph            = new WeakIOptimizedPersistableReference <Graph>(graph);
 }
示例#2
0
 internal PropertyType(bool isVertexProp, TypeId typeId, PropertyId propertyId, string name, Graph graph)
 {
   m_typeId = typeId;
   m_isVertexProperty = isVertexProp;
   m_propertyId = propertyId;
   m_propertyName = name;
   m_graph = new WeakIOptimizedPersistableReference<Graph>(graph);
 }
示例#3
0
    /// <summary>
    ///   Creates an instance and makes sure properties are defaulted correctly.
    /// </summary>
    /// <param name = "recordType">Type of the record.</param>
    /// <param name = "isRecordDefinition">if set to <c>true</c> [is record definition].</param>
    /// <param name = "recordDefinition">The record definition.</param>

    public BaseRecord(string recordType, bool isRecordDefinition, WeakIOptimizedPersistableReference<RecordDefinition> recordDefinition)
    {
      Behaviors = new System.Collections.Generic.List<OptimizedPersistable>();
      RecordType = recordType;
      IsRecordDefinition = isRecordDefinition;
      myRecordDefinitionRef = recordDefinition;
      When = DateTime.UtcNow;
    }
示例#4
0
        public TokenStoreHit(SessionBase session)
        {
            var tree = new BTreeSet <Oid>();

            session.Persist(tree);
            session.Persist(this);
            m_tokenInProduct = new WeakIOptimizedPersistableReference <BTreeSet <Oid> >(tree);
        }
示例#5
0
        /// <summary>
        ///   Creates an instance and makes sure properties are defaulted correctly.
        /// </summary>
        /// <param name = "recordType">Type of the record.</param>
        /// <param name = "isRecordDefinition">if set to <c>true</c> [is record definition].</param>
        /// <param name = "recordDefinition">The record definition.</param>

        public BaseRecord(string recordType, bool isRecordDefinition, WeakIOptimizedPersistableReference <RecordDefinition> recordDefinition)
        {
            Behaviors             = new System.Collections.Generic.List <OptimizedPersistable>();
            RecordType            = recordType;
            IsRecordDefinition    = isRecordDefinition;
            myRecordDefinitionRef = recordDefinition;
            When = DateTime.UtcNow;
        }
示例#6
0
 public Attachment(string filePath, string fileName, string note, byte[] content, string contentType, Issue issue)
 {
   m_fileName = fileName;
   m_filePath = filePath;
   m_comment = note;
   m_contentType = contentType;
   m_fileContent = content;
   if (issue != null)
     m_issueAttachedTo = new WeakIOptimizedPersistableReference<Issue>(issue);
 }
示例#7
0
 public void InitChildrenIfNecessary()
 {
   if (childrenWeakReference == null)
   {
     var childrenList = new VelocityDbList<DataBaseFileEntry>();
     childrenList.Persist(Session, this);
     childrenWeakReference = new WeakIOptimizedPersistableReference<VelocityDbList<DataBaseFileEntry>>(childrenList);
     Update();
   }
 }
示例#8
0
 public void InitChildrenIfNecessary()
 {
     if (childrenWeakReference == null)
     {
         var childrenList = new VelocityDbList <DataBaseFileEntry>();
         childrenList.Persist(Session, this);
         childrenWeakReference = new WeakIOptimizedPersistableReference <VelocityDbList <DataBaseFileEntry> >(childrenList);
         Update();
     }
 }
示例#9
0
 public Attachment(string filePath, string fileName, string note, byte[] content, string contentType, Issue issue)
 {
     m_fileName    = fileName;
     m_filePath    = filePath;
     m_comment     = note;
     m_contentType = contentType;
     m_fileContent = content;
     if (issue != null)
     {
         m_issueAttachedTo = new WeakIOptimizedPersistableReference <Issue>(issue);
     }
 }
示例#10
0
 public Person(Person person = null) // creates a random Person object
 {
   int r = randGen.Next(99999);
   firstName = r.ToString();
   r = randGen.Next(99999999);
   lastName = r.ToString();
   VelocityDbList<Person> personList = new VelocityDbList<Person>();
   if (person != null && person.IsPersistent)
   {
     personList.Persist(person.Session, person);
     personList.Add(person);
     friendsRef = new WeakIOptimizedPersistableReference<VelocityDbList<Person>>(personList);
   }
 }
示例#11
0
 public ArrayOfWeakrefs(SessionBase session)
 {
   anArrayOfWeakRefs = new WeakIOptimizedPersistableReference<Person>[10];
   Person p = new Person();
   p.Persist(session, p);
   anArrayOfWeakRefs[0] = new  WeakIOptimizedPersistableReference<Person>(p);
   p = new Person();
   p.Persist(session, p);
   anArrayOfWeakRefs[1] = new  WeakIOptimizedPersistableReference<Person>(p);
   p = new Person();
   p.Persist(session, p);
   anArrayOfWeakRefs[2] = new  WeakIOptimizedPersistableReference<Person>(p);
   p = new Person();
   p.Persist(session, p);
   anArrayOfWeakRefs[3] = new  WeakIOptimizedPersistableReference<Person>(p);
 }
示例#12
0
		public Person(Person spouse, Person bestFriend)
		{
			//int r = randGen.Next(99999);
			//firstName = r.ToString();
			//r = randGen.Next(999999999);
			//lastName = r.ToString();
      m_firstName = "用して更新されます";
      m_lastName = "イベントサブスクリプションと通知は、クライアント/サーバAPIに追加";
      m_age = (UInt16)s_randGen.Next(150);
			m_ssn = s_randGen.Next();
      if (spouse != null)
        this.m_spouse = new WeakIOptimizedPersistableReference<Person>(spouse);
      this.m_pets = new List<Pet>();
      if (bestFriend != null)
        this.m_bestFriend = new WeakIOptimizedPersistableReference<Person>(bestFriend);
		}
示例#13
0
    public Person(string firstName, string lastName, UInt16 age, long ssn, Person bestFriend, Person spouse)
		{
			m_firstName = firstName;
			m_lastName = lastName;
			m_age = age;
			m_ssn = ssn;
      if (spouse != null)
			  m_spouse = new WeakIOptimizedPersistableReference<Person>(spouse);
      m_pets = new List<Pet>();
      m_friends = new VelocityDbList<WeakIOptimizedPersistableReference<Person>>(0);
      if (bestFriend != null)
      {
        m_bestFriend = new WeakIOptimizedPersistableReference<Person>(bestFriend);
        m_friends.Add(new WeakIOptimizedPersistableReference<Person>(bestFriend));
      }
		}
示例#14
0
        public Person(Person person = null) // creates a random Person object
        {
            int r = randGen.Next(99999);

            firstName = r.ToString();
            r         = randGen.Next(99999999);
            lastName  = r.ToString();
            VelocityDbList <Person> personList = new VelocityDbList <Person>();

            if (person != null && person.IsPersistent)
            {
                personList.Persist(person.Session, person);
                personList.Add(person);
                friendsRef = new WeakIOptimizedPersistableReference <VelocityDbList <Person> >(personList);
            }
        }
示例#15
0
        public ArrayOfWeakrefs(SessionBase session)
        {
            anArrayOfWeakRefs = new WeakIOptimizedPersistableReference <Person> [10];
            Person p = new Person();

            p.Persist(session, p);
            anArrayOfWeakRefs[0] = new  WeakIOptimizedPersistableReference <Person>(p);
            p = new Person();
            p.Persist(session, p);
            anArrayOfWeakRefs[1] = new  WeakIOptimizedPersistableReference <Person>(p);
            p = new Person();
            p.Persist(session, p);
            anArrayOfWeakRefs[2] = new  WeakIOptimizedPersistableReference <Person>(p);
            p = new Person();
            p.Persist(session, p);
            anArrayOfWeakRefs[3] = new  WeakIOptimizedPersistableReference <Person>(p);
        }
示例#16
0
 public Person(string firstName, string lastName, UInt16 age, long ssn, Person bestFriend, Person spouse)
 {
     m_firstName = firstName;
     m_lastName  = lastName;
     m_age       = age;
     m_ssn       = ssn;
     if (spouse != null)
     {
         m_spouse = new WeakIOptimizedPersistableReference <Person>(spouse);
     }
     m_pets    = new List <Pet>();
     m_friends = new VelocityDbList <WeakIOptimizedPersistableReference <Person> >(0);
     if (bestFriend != null)
     {
         m_bestFriend = new WeakIOptimizedPersistableReference <Person>(bestFriend);
         m_friends.Add(new WeakIOptimizedPersistableReference <Person>(bestFriend));
     }
 }
示例#17
0
 public Person(Person spouse, Person bestFriend)
 {
     //int r = randGen.Next(99999);
     //firstName = r.ToString();
     //r = randGen.Next(999999999);
     //lastName = r.ToString();
     m_firstName = "用して更新されます";
     m_lastName  = "イベントサブスクリプションと通知は、クライアント/サーバAPIに追加";
     m_age       = (UInt16)s_randGen.Next(150);
     m_ssn       = s_randGen.Next();
     if (spouse != null)
     {
         this.m_spouse = new WeakIOptimizedPersistableReference <Person>(spouse);
     }
     this.m_pets = new List <Pet>();
     if (bestFriend != null)
     {
         this.m_bestFriend = new WeakIOptimizedPersistableReference <Person>(bestFriend);
     }
 }
示例#18
0
 internal VertexType(TypeId aTypeId, string aTypeName, VertexType baseType, Graph graph)
 {
   m_graph = new WeakIOptimizedPersistableReference<Graph>(graph);
   m_baseType = baseType;
   m_subTypes = new List<VertexType>();
   if (baseType != null)
   {
     baseType.Update();
     baseType.m_subTypes.Add(this);
   }
   m_typeId = (TypeId)aTypeId;
   m_typeName = aTypeName;
   var vertices = new VelocityDbList<Range<VertexId>>();
   graph.Session.Persist(vertices);
   m_vertices = new WeakIOptimizedPersistableReference<VelocityDbList<Range<VertexId>>>(vertices);
   m_stringToPropertyType = new BTreeMap<string, PropertyType>(null, graph.Session);
   m_edgeTypes = new BTreeSet<EdgeType>(null, graph.Session);
   m_tailToHeadEdges = new BTreeMap<EdgeType, BTreeMap<VertexType, BTreeMap<VertexId, BTreeSet<EdgeIdVertexId>>>>(null, graph.Session);
   m_headToTailEdges = new BTreeMap<EdgeType, BTreeMap<VertexType, BTreeMap<VertexId, BTreeSet<EdgeIdVertexId>>>>(null, graph.Session);
   graph.Session.Persist(this);
 }
示例#19
0
        /// <summary>
        /// Creates a new edge type.
        /// </summary>
        /// <param name="aTypeId">The id to use for the new edge type</param>
        /// <param name="aTypeName">A type name to use</param>
        /// <param name="tailType">Restrict tail vertex to a certain vertex type</param>
        /// <param name="headType">Restrict head vertex to a certain vertex type</param>
        /// <param name="birectional">Is this edge type bidirectional (going both ways)</param>
        /// <param name="baseType">A base type can be specified</param>
        /// <param name="graph">The owning graph</param>
        public EdgeType(TypeId aTypeId, string aTypeName, VertexType tailType, VertexType headType, bool birectional, EdgeType baseType, Graph graph)
        {
            m_graph    = new WeakIOptimizedPersistableReference <Graph>(graph);
            m_baseType = baseType;
            m_subTypes = new List <EdgeType>();
            if (baseType != null)
            {
                baseType.Update();
                baseType.m_subTypes.Add(this);
            }
            m_birectional = birectional;
            m_typeId      = aTypeId;
            m_typeName    = aTypeName;
            if (tailType != null)
            {
                m_tailType = new WeakIOptimizedPersistableReference <VertexType>(tailType);
            }
            if (headType != null)
            {
                m_headType = new WeakIOptimizedPersistableReference <VertexType>(headType);
            }
            if (Unrestricted)
            {
                m_unrestrictedEdges = new BTreeMap <EdgeId, UnrestrictedEdge>(null, graph.GetSession());
            }
            else
            {
                m_restrictedEdges = new BTreeMap <EdgeId, ulong>(null, graph.GetSession());
            }
            m_stringToPropertyType = new BTreeMap <string, PropertyType>(null, graph.GetSession());
            var edgeRanges = new VelocityDbList <Range <EdgeId> >();

            graph.GetSession().Persist(edgeRanges);
            m_edgeRanges = new WeakIOptimizedPersistableReference <VelocityDbList <Range <PropertyId> > >(edgeRanges);
            graph.GetSession().Persist(this);
        }
示例#20
0
 public AllSupported(Int32 arraySize)
 {
   enum16list = new List<Int16Enum>(arraySize);
   aSnake = new PersistenceByInterfaceSnake("Curly", 1, true, 58);
   jaggedArray[0] = new int[] { 1, 3, 5, 7, 9 };
   jaggedArray[1] = new int[] { 0, 2, 4, 6 };
   jaggedArray[2] = new int[] { 11, 22 };
   m_nullabledateTime = null;
   m_nullableByte = null;
   m_enumByte = ByteEnum.b;
   m_enumInt16 = Int16Enum.c;
   m_enumInt32 = Int32Enum.f;
   m_enumInt64 = Int64Enum.ff;
   m_objectArray = new object[arraySize];
   m_objectInterfaceArray = new ISomeStuff[arraySize];
   byteArray = new byte[arraySize];
   charArray = new char[arraySize];
   m_weakRefArray = new WeakIOptimizedPersistableReference<IOptimizedPersistable>[arraySize];
   uint16Array = new UInt16[arraySize];
   uint32Array = new UInt32[arraySize];
   uint64Array = new UInt64[arraySize];
   int16Array = new Int16[arraySize];
   int32Array = new Int32[arraySize];
   int64Array = new Int64[arraySize];
   floatArray = new float[arraySize];
   doubleArray = new double[arraySize];
   dateTimeArray = new DateTime[arraySize];
   oidArray = new Oid[arraySize];
   nullablebyteArray = new byte?[arraySize];
   nullablecharArray = new char?[arraySize];
   nullableuint16Array = new UInt16?[arraySize];
   nullableuint32Array = new UInt32?[arraySize];
   nullableuint64Array = new UInt64?[arraySize];
   nullableint16Array = new Int16?[arraySize];
   nullableint32Array = new Int32?[arraySize];
   nullableint64Array = new Int64?[arraySize];
   nullablefloatArray = new float?[arraySize];
   nullabledoubleArray = new double?[arraySize];
   nullableDateTimeArray = new DateTime?[arraySize];
   nullableDecimalArray = new Decimal?[arraySize];
   nullableGuidArray = new Guid?[arraySize];
   nullableOidArray = new Oid?[arraySize];
   listByte = new List<byte>(arraySize); // just samples of what Key can be
   personList = new List<Person>(arraySize);
   petListOidShort = new List<Pet>(arraySize);
   petListLongOid = new List<Pet>(arraySize);
   petList2 = new ArrayList(arraySize);
   int32List = new List<Int32>(arraySize);
   uint32List = new List<UInt32>(arraySize);
   uint64List = new List<ulong>(arraySize);
   oidList = new List<Oid>(arraySize);
   nullableoidList = new List<Oid?>(arraySize);
   personHashSet = new VelocityDbHashSet<Person>();
   person = new Person();
   timeSpan = new TimeSpan(1, 0, 0);
   personArrayOidShort = new Person[arraySize];
   if (arraySize > 1)
     personArrayOidShort[1] = new Person();
   personArrayOidShort[0] = null;
   personListShort = new List<Person>(arraySize);
   personListShort.Add(null);
   personListShort.Add(null);
   personListShort.Add(new Person());
   aPet = new Cat("Boze", 5);
   petListOidShort.Add(aPet);
   petListOidShort.Add(null);
   petListLongOid.Add(aPet);
   petList2.Add(aPet);
   uint32List.Add(5555);
   int32List.Add(-66666);
   uint64List.Add(8989898988989);
   doubleArray[0] = 0.2323232323232;
   aSlot = new Slot();
   aSlot.value = new Person();
   m_slots = new Slot[5];
   enum16list.Add(m_enumInt16);
   nullableoidList.Add(new Oid((ulong)4444));
   nullableoidList.Add(null);
   nullableoidList.Add(new Oid((ulong)8888));
   if (arraySize > 0)
   {
     oidArray[0] = new Oid((ulong)99999);
     nullableOidArray[0] = new Oid((ulong)99999);
     nullableint32Array[0] = 5;
   }
   if (arraySize > 2)
   {
     m_objectArray[1] = this;
     m_objectInterfaceArray[2] = this;
     oidArray[2] = new Oid((ulong)66666);
     nullableOidArray[2] = new Oid((ulong)66666);
     nullableint32Array[2] = 6;
   }
   for (int i = 0; i < 5; i++)
   {
     m_slots[i].hashCode = i;
     m_slots[i].value = new Person();
     m_slots[i].next = i + 1;
   }
 }