Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some data type not supported #46

Closed
gohsianghwee opened this issue Mar 6, 2015 · 1 comment
Closed

Some data type not supported #46

gohsianghwee opened this issue Mar 6, 2015 · 1 comment
Labels

Comments

@gohsianghwee
Copy link
Contributor

Hi,

I am encountering issues on some data types like List and array with enum type.

Here's the code.

public static void TestOrientDBObjectTypeSupported()
{
var GlobalTestDatabaseName = "TestDatabaseNameAlias";
var GlobalTestDatabaseType = ODatabaseType.Graph;
var GlobalTestDatabaseAlias = "TestDatabaseNameAlias";

        _server = new OServer(_hostname, _port, _rootUserName, _rootUserParssword);
        if (_server.DatabaseExist(GlobalTestDatabaseName, OStorageType.PLocal))
        {
            _server.DropDatabase(GlobalTestDatabaseName, OStorageType.PLocal);

        }

        _server.CreateDatabase(GlobalTestDatabaseName, GlobalTestDatabaseType, OStorageType.PLocal);

        OClient.CreateDatabasePool(
            _hostname,
            _port,
            GlobalTestDatabaseName,
            GlobalTestDatabaseType,
            _username,
            _password,
            10,
            GlobalTestDatabaseAlias
        );
        DateTime startTime = DateTime.Now;
        Console.WriteLine("Start Time: " + startTime.ToLongTimeString());

        using (ODatabase database = new ODatabase(GlobalTestDatabaseName))
        {
            database.Create.Class<DemoEmployee>().Run();

            for (int index = 1; index <= 1; index++)
            {
                var employee = new DemoEmployee();
                employee.SomeOtherId = Guid.NewGuid();
                employee.Name = "Janet";
                employee.Age = index;
                employee.WorkingDays = new List<DayOfWeek>();
                employee.WorkingDays.Add(DayOfWeek.Monday);
                employee.WorkingDays.Add(DayOfWeek.Tuesday);
                employee.WorkingDays.Add(DayOfWeek.Wednesday);

                database.Insert<DemoEmployee>(employee).Run();
            }
        }



    }

public class DemoEmployee
{
public Guid SomeOtherId { get; set; }

    public string Name { get; set; }

    public int Age { get; set; }

    public long SomeVeryLongNumber { get; set; }

    public decimal Salary { get; set; }

    public List<DayOfWeek> WorkingDays { get; set; }
    public DateTime? IncrementDate { get; set; }

    public int? Height { get; set; }
    public double Commission { get; set; }

    public float Allowance { get; set; }

    public DateTime BirthDate { get; set; }

    public bool IsMarried { get; set; }

    public List<int> SomeIntegerList { get; set; }

    public int[] SomeIntegerArrayList { get; set; }

    public List<decimal> SomeDecimalList { get; set; }

    public decimal[] SomeDecomeArray { get; set; }

    public List<DemoChild> Kids { get; set; }
    public IList<int> SomeIListInteger { get; set; }

    public Dictionary<int, string> MyKeyValues { get; set; }

    public SortedList<int, string> YearlyAchievement { get; set; }

    public Color MyFavoriteColor { get; set; }
    public enum Color
    {
        Blue, Red
    }
}

Please let me know if you need more info. Thanks.

Cordially,
Goh

GoorMoon added a commit that referenced this issue Mar 6, 2015
@GoorMoon GoorMoon added the bug label Mar 6, 2015
@GoorMoon
Copy link
Contributor

GoorMoon commented Mar 7, 2015

Should be fine look for the test case of fix

@GoorMoon GoorMoon closed this as completed Mar 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants