Skip to content

Ability to select entities in Criteria projections #1471

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

Merged
merged 14 commits into from
Dec 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
463 changes: 463 additions & 0 deletions src/NHibernate.Test/Async/Criteria/EntityProjectionsTest.cs

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions src/NHibernate.Test/Criteria/EntityProjectionsEntities.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;

namespace NHibernate.Test.Criteria
{
public class EntitySimpleChild
{
public virtual Guid Id { get; set; }
public virtual string Name { get; set; }
}

public class EntityComplex
{
public virtual Guid Id { get; set; }

public virtual int Version { get; set; }

public virtual string Name { get; set; }

public virtual string LazyProp { get; set; }

public virtual EntitySimpleChild Child1 { get; set; }
public virtual EntitySimpleChild Child2 { get; set; }
public virtual EntityComplex SameTypeChild { get; set; }

public virtual IList<EntitySimpleChild> ChildrenList { get; set; }
}

public class CompositeKey
{
public int Id1 { get; set; }
public int Id2 { get; set; }

public override bool Equals(object obj)
{
var key = obj as CompositeKey;
return key != null
&& Id1 == key.Id1
&& Id2 == key.Id2;
}

public override int GetHashCode()
{
var hashCode = -1596524975;
hashCode = hashCode * -1521134295 + Id1.GetHashCode();
hashCode = hashCode * -1521134295 + Id2.GetHashCode();
return hashCode;
}
}

public class EntityWithCompositeId
{
public virtual CompositeKey Key { get; set; }
public virtual string Name { get; set; }
}
}
Loading