Exemplo n.º 1
0
            public void ChnageFunctionalId()
            {
                FunctionalId toChangeFunctionalId = FunctionalIds.New("ChangeAccount", "CA_", IdFormat.Hash);

                Entities["Account"].Refactor.SetFunctionalId(toChangeFunctionalId, ApplyAlgorithm.ReapplyAll);
                Assert.AreEqual(Entities["Account"].FunctionalId, toChangeFunctionalId);
            }
Exemplo n.º 2
0
            public void Script_0_0_0()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);

                Entities.New("BaseEntity")
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .Abstract(true)
                .Virtual(true)
                .SetKey("Uid", true)
                .AddProperty("LastModifiedOn", typeof(DateTime))
                .SetRowVersionField("LastModifiedOn");

                Entities.New("Person", Entities["BaseEntity"])
                .AddProperty("Name", typeof(string));

                Entities.New("Movie", Entities["BaseEntity"])
                .AddProperty("Title", typeof(string), IndexType.Unique)
                .AddProperty("ToMoveProperty", typeof(string));

                Relations.New(Entities["Person"], Entities["Movie"], "PERSON_DIRECTED", "DIRECTED_BY")
                .SetInProperty("DirectedMovies", PropertyType.Collection)
                .SetOutProperty("Director", PropertyType.Lookup);

                Relations.New(Entities["Person"], Entities["Movie"], "ACTED_IN", "ACTORS")
                .SetInProperty("ActedInMovies", PropertyType.Collection)
                .SetOutProperty("Actors", PropertyType.Collection);
            }
Exemplo n.º 3
0
            public void Script_0_0_0()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);

                Entities.New("BaseEntity")
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .Abstract(true)
                .Virtual(true)
                .SetKey("Uid", true)
                .AddProperty("LastModifiedOn", typeof(DateTime))
                .SetRowVersionField("LastModifiedOn");

                Entities.New("Scene", Entities["BaseEntity"])
                .AddProperty("Name", typeof(string), IndexType.Unique)
                .AddProperty("BoolToLong", typeof(bool))
                .AddProperty("BoolToDouble", typeof(bool))
                .AddProperty("BoolToString", typeof(bool))
                .AddProperty("LongToBool", typeof(long))
                .AddProperty("LongToDouble", typeof(long))
                .AddProperty("LongToString", typeof(long))
                .AddProperty("DoubleToBool", typeof(double))
                .AddProperty("DoubleToLong", typeof(double))
                .AddProperty("DoubleToString", typeof(double))
                .AddProperty("StringToBool", typeof(string))
                .AddProperty("StringToLong", typeof(string))
                .AddProperty("StringToDouble", typeof(string));
            }
Exemplo n.º 4
0
            public void UpdateFunctionalId()
            {
                FunctionalId account = FunctionalIds.New("Account", "A_", IdFormat.Hash);

                Entities["Account"].Refactor.SetFunctionalId(account);
                Assert.AreEqual(Entities["Account"].FunctionalId, account);
            }
Exemplo n.º 5
0
            public void Initialize()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);

                Entities.New("Account")
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .SetKey("Uid", true)
                .AddProperty("Name", typeof(string), false)
                .SetFullTextProperty("Name");
            }
Exemplo n.º 6
0
            public void Initialize()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);

                Entities.New("BaseEntity")
                .AddProperty("Uid", typeof(string), false)
                .Abstract(true)
                .Virtual(true)
                .SetKey("Uid", true)
                .AddProperty("LastModifiedOn", typeof(DateTime))
                .SetRowVersionField("LastModifiedOn");
            }
Exemplo n.º 7
0
            public void Initialize()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);

                Entities.New("AccountType")
                .Summary("The type of an Account")
                .HasStaticData(true)
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .SetKey("Uid", true)
                .AddProperty("Name", typeof(string), false, IndexType.Unique)
                .SetFullTextProperty("Name");

                Entities["AccountType"].Refactor.CreateNode(new { Uid = "6", Name = "Account" });
            }
Exemplo n.º 8
0
            public void Script_0_0_0()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);

                Entities.New("BaseEntity")
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .Abstract(true)
                .Virtual(true)
                .SetKey("Uid", true)
                .AddProperty("LastModifiedOn", typeof(DateTime))
                .SetRowVersionField("LastModifiedOn");

                Entities.New("Person", Entities["BaseEntity"])
                .AddProperty("Name", typeof(string))
                .AddProperty("MandatoryProperty", typeof(int), false);

                Entities.New("Movie", Entities["BaseEntity"])
                .AddProperty("Title", typeof(string), IndexType.Unique)
                .AddProperty("ReleaseDate", typeof(DateTime));

                Relations.New(Entities["Person"], Entities["Movie"], "DIRECTED_BY", "DIRECTED_BY")
                .SetInProperty("DirectedMovies", PropertyType.Collection)
                .SetOutProperty("Director", PropertyType.Lookup);

                Relations.New(Entities["Person"], Entities["Movie"], "ACTED_IN", "ACTORS")
                .SetInProperty("ActedInMovies", PropertyType.Collection)
                .SetOutProperty("Actors", PropertyType.Collection);

                Entities.New("Genre", Entities["BaseEntity"])
                .AddProperty("Name", typeof(string), IndexType.Unique)
                .HasStaticData(true)
                .SetFullTextProperty("Name");

                Relations.New(Entities["Movie"], Entities["Genre"], "MOVIE_HAS", "MOVIE_HAS")
                .SetInProperty("MovieGenre", PropertyType.Lookup)
                .SetOutProperty("Movies", PropertyType.Collection);

                Relations.New(Entities["Person"], Entities["Genre"], "LIKES", "LIKES")
                .SetInProperty("MovieGenre", PropertyType.Lookup)
                .SetOutProperty("Person", PropertyType.Collection);

                Entities["Genre"].Refactor.CreateNode(new { Uid = "7", Name = "Action" });
                Entities["Genre"].Refactor.CreateNode(new { Uid = "8", Name = "Adventure" });
                Entities["Genre"].Refactor.CreateNode(new { Uid = "9", Name = "Comedy" });
                Entities["Genre"].Refactor.CreateNode(new { Uid = "10", Name = "Drama" });
                Entities["Genre"].Refactor.CreateNode(new { Uid = "11", Name = "Horror" });
                Entities["Genre"].Refactor.CreateNode(new { Uid = "12", Name = "Musical" });
                Entities["Genre"].Refactor.CreateNode(new { Uid = "13", Name = "Science Fiction" });
            }
Exemplo n.º 9
0
            public void Script_0_0_0()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);

                Entities.New("BaseEntityGenerator")
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .Abstract(true)
                .Virtual(true)
                .SetKey("Uid", true)
                .AddProperty("LastModifiedOn", typeof(DateTime))
                .SetRowVersionField("LastModifiedOn");

                Entities.New("PersonEntity", Entities["BaseEntityGenerator"])
                .AddProperty("Name", typeof(string));
            }
Exemplo n.º 10
0
            public void Initialize()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);

                Entities.New("ContactStatus")
                .HasStaticData(true)
                .AddProperty("OrderBy", typeof(string))
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .SetKey("Uid", true)
                .AddProperty("Name", typeof(string), false, IndexType.Unique);

                Entities["ContactStatus"].Refactor.CreateNode(new { Uid = "1", Name = "Active", OrderBy = "1" });
                Entities["ContactStatus"].Refactor.CreateNode(new { Uid = "2", Name = "Inactive", OrderBy = "5" });
                Entities["ContactStatus"].Refactor.CreateNode(new { Uid = "3", Name = "Blacklisted", OrderBy = "10" });
            }
Exemplo n.º 11
0
            public void Initialize()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);
                FunctionalId account = FunctionalIds.New("Account", "A_", IdFormat.Hash);

                Entities.New("BaseAccount", account)
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .SetKey("Uid", true);

                Entities.New("Account", Entities["BaseAccount"])
                .AddProperty("Name", typeof(string), false)
                .SetFullTextProperty("Name");

                Assert.AreEqual(Entities["Account"].FunctionalId, account);
            }
Exemplo n.º 12
0
            public void Initialize()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);

                Entities.New("AccountType")
                .Summary("The type of an Account")
                .HasStaticData(true)
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .SetKey("Uid", true)
                .AddProperty("Name", typeof(string), false, IndexType.Unique)
                .SetFullTextProperty("Name");

                Entities["AccountType"].Refactor.CreateNode(new { Uid = "6", Name = "Account" });
                Entities["AccountType"].Refactor.CreateNode(new { Uid = "81", Name = "MTMSAccount" });
                Entities["AccountType"].Refactor.CreateNode(new { Uid = "89", Name = "FinancialAccount" });
                Entities["AccountType"].Refactor.CreateNode(new { Uid = "90", Name = "BillingAccount" });
                Entities["AccountType"].Refactor.CreateNode(new { Uid = "91", Name = "AxaptaAccount" });
                Entities["AccountType"].Refactor.CreateNode(new { Uid = "349", Name = "Aircraft" });
                Entities["AccountType"].Refactor.CreateNode(new { Uid = "350", Name = "Installation" });
                Entities["AccountType"].Refactor.CreateNode(new { Uid = "351", Name = "SiteTrackingObject" });
                Entities["AccountType"].Refactor.CreateNode(new { Uid = "352", Name = "StaticSite" });
                Entities["AccountType"].Refactor.CreateNode(new { Uid = "353", Name = "Vessel" });

                Entities.New("ContactStatus")
                .Summary("The ContactStatus is describing the status of a Contact")
                .Example("Active, Inactive, Blacklisted")
                //.HasStaticData(true)
                .AddProperty("OrderBy", typeof(string))
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .SetKey("Uid", true)
                .AddProperty("Name", typeof(string), false, IndexType.Unique);

                Entities["ContactStatus"].Refactor.CreateNode(new { Uid = "1", Name = "Active", OrderBy = "1" });
                Entities["ContactStatus"].Refactor.CreateNode(new { Uid = "2", Name = "Inactive", OrderBy = "5" });
                Entities["ContactStatus"].Refactor.CreateNode(new { Uid = "3", Name = "Blacklisted", OrderBy = "10" });

                Entities.New("ReferenceType")
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .SetKey("Uid", true)
                .AddProperty("Name", typeof(string), false)
                .AddProperty("Fields", typeof(List <string>));

                Entities["ReferenceType"].Refactor.CreateNode(new { Uid = "1", Name = "Opportunity", Fields = new List <string>()
                                                                    {
                                                                        "Field1"
                                                                    } });
            }
Exemplo n.º 13
0
            public void Initialize()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);

                Entities.New("BaseOne")
                .Abstract(true)
                .Virtual(true)
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .SetKey("Uid", true)
                .AddProperty("LastModifiedOn", typeof(DateTime))
                .SetRowVersionField("LastModifiedOn");

                Entities.New("BaseTwo", Entities["BaseOne"]);

                Entities.New("Child", Entities["BaseOne"])
                .AddProperty("Name", typeof(string), false);
            }
Exemplo n.º 14
0
            public void Initialize()
            {
                FunctionalIds.Default = FunctionalIds.New("Shared", "0", IdFormat.Numeric, 0);

                Entities.New("BaseEntityWithRowVersion")
                .AddProperty("Uid", typeof(string), false, IndexType.Unique)
                .Abstract(true)
                .Virtual(true)
                .SetKey("Uid", true)
                .AddProperty("LastModifiedOn", typeof(DateTime))
                .SetRowVersionField("LastModifiedOn");

                Entities.New("PersonInheritedBase", Entities["BaseEntityWithRowVersion"])
                .AddProperty("Name", typeof(string));

                Entities.New("AddressWithNoParent")
                .AddProperty("Name", typeof(string))
                .AddProperty("LastModifiedOn", typeof(DateTime));
            }
Exemplo n.º 15
0
        protected void Initial()
        {
            FunctionalIds.Default = FunctionalIds.New("Shared", "SH_", IdFormat.Numeric, 0);


            Entities.New("Genre")
            .HasStaticData(true)
            .AddProperty("Uid", typeof(string), false, IndexType.Unique)
            .SetKey("Uid", true)
            .AddProperty("Name", typeof(string), false);

            Entities.New("Movie")
            .AddProperty("title", typeof(string))
            .AddProperty("tagline", typeof(string))
            .AddProperty("released", typeof(int))
            .AddProperty("Uid", typeof(string), false, IndexType.Unique)
            .SetKey("Uid", true);

            Entities.New("MovieReview")
            .AddProperty("Uid", typeof(string), false, IndexType.Unique)
            .SetKey("Uid", true)
            .AddProperty("Review", typeof(string))
            .AddProperty("Rating", typeof(decimal));

            Entities.New("MovieRole")
            .AddProperty("Uid", typeof(string), false, IndexType.Unique)
            .SetKey("Uid", true)
            .AddProperty("Role", typeof(List <string>));

            Entities.New("Person")
            .AddProperty("name", typeof(string))
            .AddProperty("born", typeof(int))
            .AddProperty("Uid", typeof(string), false, IndexType.Unique)
            .SetKey("Uid", true);


            Relations.New(Entities["Movie"], Entities["Genre"], "CONTAINS_GENRE", "CONTAINS_GENRE")
            .SetInProperty("Genres", PropertyType.Collection)
            .SetOutProperty("Movies", PropertyType.Collection);

            Relations.New(Entities["Person"], Entities["Movie"], "ACTED_IN", "ACTED_IN")
            .SetInProperty("ActedMovies", PropertyType.Collection)
            .SetOutProperty("Actors", PropertyType.Collection);

            Relations.New(Entities["Person"], Entities["Movie"], "DIRECTED", "DIRECTED")
            .SetInProperty("DirectedMovies", PropertyType.Collection)
            .SetOutProperty("Directors", PropertyType.Collection);

            Relations.New(Entities["Person"], Entities["Movie"], "PRODUCED", "PRODUCED")
            .SetInProperty("ProducedMovies", PropertyType.Collection)
            .SetOutProperty("Producers", PropertyType.Collection);

            Relations.New(Entities["Person"], Entities["Movie"], "WROTE", "WROTE")
            .SetInProperty("WritedMovies", PropertyType.Collection)
            .SetOutProperty("Writers", PropertyType.Collection);

            Relations.New(Entities["MovieRole"], Entities["Movie"], "MOVIEROLE_HAS_MOVIE", "HAS_MOVIE")
            .SetInProperty("Movie", PropertyType.Lookup);

            Relations.New(Entities["MovieReview"], Entities["Movie"], "MOVIEREVIEW_HAS_MOVIE", "HAS_REVIEWED_MOVIE")
            .SetInProperty("Movie", PropertyType.Lookup);

            Relations.New(Entities["Person"], Entities["MovieReview"], "MOVIE_REVIEWS", "MOVIE_REVIEWS")
            .SetInProperty("MovieReviews", PropertyType.Collection);

            Relations.New(Entities["Person"], Entities["MovieRole"], "MOVIE_ROLES", "MOVIE_ROLES")
            .SetInProperty("MovieRoles", PropertyType.Collection);

            Relations.New(Entities["Person"], Entities["Person"], "FOLLOWS", "FOLLOWS")
            .SetInProperty("FollowedPersons", PropertyType.Collection)
            .SetOutProperty("Followers", PropertyType.Collection);


            Entities["Genre"].Refactor.CreateNode(new { Uid = "1", Name = "Action" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "2", Name = "Animation" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "3", Name = "Biography" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "4", Name = "Comedy" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "5", Name = "Documentary" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "6", Name = "Drama" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "7", Name = "Fantasy" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "8", Name = "Horror" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "9", Name = "Musical" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "10", Name = "Reality-Tv" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "11", Name = "Romance" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "12", Name = "Sci-Fi" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "13", Name = "Short" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "14", Name = "Talk-Show" });
            Entities["Genre"].Refactor.CreateNode(new { Uid = "15", Name = "Thriller" });
        }
Exemplo n.º 16
0
            public void UpdateFunctionalId()
            {
                FunctionalId toChangeFunctionalId = FunctionalIds.New("ChangeAccount", "CA_", IdFormat.Hash);

                Entities["Account"].Refactor.SetFunctionalId(toChangeFunctionalId);
            }