Skip to content

NOT READY FOR PULL - You'll want to review the change set and integrate the way you see fit. #2

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

Closed
wants to merge 2 commits into from
Closed
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
1 change: 0 additions & 1 deletion src/Iesi.Collections.Test/Iesi.Collections.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Generic\HashedSetFixture.cs" />
<Compile Include="Generic\ImmutableSetFixture.cs" />
<Compile Include="Generic\OrderedSetFixture.cs" />
Expand Down
1 change: 0 additions & 1 deletion src/Iesi.Collections/Iesi.Collections.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="DictionarySet.cs" />
<Compile Include="Generic\DictionarySet.cs" />
<Compile Include="Generic\HashedSet.cs" />
Expand Down
15 changes: 15 additions & 0 deletions src/NHibernate.DependencyInjection.Tests/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory name="Default">
<property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property>
<property name="connection.connection_string">Data Source=Database.sdf</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="dialect">NHibernate.Dialect.MsSqlCeDialect</property>
</session-factory>
</hibernate-configuration>
</configuration>
Binary file not shown.
13 changes: 13 additions & 0 deletions src/NHibernate.DependencyInjection.Tests/EntityInjector.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using NHibernate.DependencyInjection.Tests.Model;

namespace NHibernate.DependencyInjection.Tests
{
public class EntityInjector : Bytecode.IEntityInjector //IEntityInjector
{
public object[] GetConstructorParameters(System.Type type)
{
if (type == typeof(DependencyInjectionCat)) return new object[] {new CatBehavior()};
return null;
}
}
}
20 changes: 20 additions & 0 deletions src/NHibernate.DependencyInjection.Tests/Model/BasicCat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Iesi.Collections.Generic;

namespace NHibernate.DependencyInjection.Tests.Model
{
public class BasicCat
{
public virtual int Id { get; protected set; }

public virtual string Name { get; set; }

private ISet<BasicCat> _kittens = new HashedSet<BasicCat>();
public virtual ISet<BasicCat> Kittens
{
get { return _kittens; }
set { _kittens = value; }
}

public virtual BasicCat Parent { get; set; }
}
}
16 changes: 16 additions & 0 deletions src/NHibernate.DependencyInjection.Tests/Model/BasicCat.hbm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.DependencyInjection.Tests" namespace="NHibernate.DependencyInjection.Tests.Model">
<!-- basic strategy (default constructor) -->
<class name="BasicCat" table="BasicCat" >
<id name="Id" column="Id" type="int">
<generator class="native" />
</id>
<property name="Name" not-null="true" type="string" />
<set name="Kittens" cascade="all-delete-orphan" inverse="true" lazy="true">
<key column="ParentId" />
<one-to-many class="BasicCat"/>
</set>
<many-to-one class="BasicCat" column="ParentId" name="Parent" />
</class>
</hibernate-mapping>

15 changes: 15 additions & 0 deletions src/NHibernate.DependencyInjection.Tests/Model/CatBehavior.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace NHibernate.DependencyInjection.Tests.Model
{
public class CatBehavior
{
public string Meow()
{
return "meow";
}

public string Purr()
{
return "purrrrr.......purrrrr......";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Iesi.Collections.Generic;

namespace NHibernate.DependencyInjection.Tests.Model
{
public class DependencyInjectionCat
{
private readonly CatBehavior _behavior;

public DependencyInjectionCat(CatBehavior behavior)
{
_behavior = behavior;
}

public virtual string Meow()
{
return _behavior.Meow();
}

public virtual string Purr()
{
return _behavior.Purr();
}

public virtual int Id { get; protected set; }

public virtual string Name { get; set; }

private ISet<DependencyInjectionCat> _kittens = new HashedSet<DependencyInjectionCat>();
public virtual ISet<DependencyInjectionCat> Kittens
{
get { return _kittens; }
set { _kittens = value; }
}

public virtual DependencyInjectionCat Parent { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.DependencyInjection.Tests" namespace="NHibernate.DependencyInjection.Tests.Model">
<!-- dependency injection startegy (not supported by default in NH) -->
<class name="DependencyInjectionCat" table="DependencyInjectionCat" >
<id name="Id" column="Id" type="int">
<generator class="native" />
</id>
<property name="Name" not-null="true" type="string" />
<set name="Kittens" cascade="all-delete-orphan" inverse="true" lazy="true">
<key column="ParentId" />
<one-to-many class="DependencyInjectionCat"/>
</set>
<many-to-one class="DependencyInjectionCat" column="ParentId" name="Parent" />
</class>
</hibernate-mapping>

12 changes: 12 additions & 0 deletions src/NHibernate.DependencyInjection.Tests/Model/IInterfaceCat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Iesi.Collections.Generic;

namespace NHibernate.DependencyInjection.Tests.Model
{
public interface IInterfaceCat
{
int Id { get; }
string Name { get; set; }
ISet<IInterfaceCat> Kittens { get; set; }
IInterfaceCat Parent { get; set; }
}
}
20 changes: 20 additions & 0 deletions src/NHibernate.DependencyInjection.Tests/Model/InterfaceCat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Iesi.Collections.Generic;

namespace NHibernate.DependencyInjection.Tests.Model
{
public class InterfaceCat : IInterfaceCat
{
public int Id { get; protected set; }

public string Name { get; set; }

private ISet<IInterfaceCat> _kittens = new HashedSet<IInterfaceCat>();
public ISet<IInterfaceCat> Kittens
{
get { return _kittens; }
set { _kittens = value; }
}

public IInterfaceCat Parent { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.DependencyInjection.Tests" namespace="NHibernate.DependencyInjection.Tests.Model">
<!-- interface strategy (proxy specified) -->
<class name="InterfaceCat" table="InterfaceCat" proxy="IInterfaceCat" >
<id name="Id" column="Id" type="int">
<generator class="native" />
</id>
<property name="Name" not-null="true" type="string" />
<set name="Kittens" cascade="all-delete-orphan" inverse="true" lazy="true">
<key column="ParentId" />
<one-to-many class="InterfaceCat"/>
</set>
<many-to-one class="InterfaceCat" column="ParentId" name="Parent" />
</class>
</hibernate-mapping>

Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{814D27A2-7FB9-4427-9042-5DD902FB52D8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NHibernate.DependencyInjection.Tests</RootNamespace>
<AssemblyName>NHibernate.DependencyInjection.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\net\3.5\Iesi.Collections.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunit.mocks, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll</HintPath>
</Reference>
<Reference Include="pnunit.framework, Version=1.0.4109.34242, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\SqlServerCompact.4.0.8482.1\lib\System.Data.SqlServerCe.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="EntityInjector.cs" />
<Compile Include="When_using_custom_bytecode_provider.cs" />
<Compile Include="Model\BasicCat.cs" />
<Compile Include="Model\CatBehavior.cs" />
<Compile Include="Model\DependencyInjectionCat.cs" />
<Compile Include="Model\IInterfaceCat.cs" />
<Compile Include="Model\InterfaceCat.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Database.sdf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="Model\InterfaceCat.hbm.xml">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Model\DependencyInjectionCat.hbm.xml">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Model\BasicCat.hbm.xml">
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NHibernate\NHibernate.csproj">
<Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project>
<Name>NHibernate</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
if not exist "$(TargetDir)x86" md "$(TargetDir)x86"
xcopy /s /y "$(SolutionDir)packages\SqlServerCompact.4.0.8482.1\NativeBinaries\x86\*.*" "$(TargetDir)x86"
if not exist "$(TargetDir)amd64" md "$(TargetDir)amd64"
xcopy /s /y "$(SolutionDir)packages\SqlServerCompact.4.0.8482.1\NativeBinaries\amd64\*.*" "$(TargetDir)amd64"</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading