Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: merdacz/Emineo
base: master
...
head fork: merdacz/Emineo
compare: supertest
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 16, 2011
@merdacz test 176621f
View
52 Source/Net.Daczkowski.Emineo.App/Program.cs
@@ -3,6 +3,12 @@
using System;
using HibernatingRhinos.Profiler.Appender.NHibernate;
using log4net;
+ using Net.Daczkowski.Emineo.Model;
+ using Net.Daczkowski.Emineo.Model.Visitors;
+ using NHibernate;
+ using NHibernate.Cfg;
+ using NHibernate.SqlCommand;
+ using NHibernate.LambdaExtensions;
public class Program
{
@@ -14,8 +20,52 @@ public static void Main(string[] args)
////PersistingProject.Launch();
////ProjectQueries.Launch();
////BatchLoad.Launch();
- Cache.Launch();
+ ////Cache.Launch();
+
+ var configuration = new Configuration()
+ .Configure("NHibernate.xml");
+ var factory = configuration.BuildSessionFactory();
+
+ //using (var session = factory.OpenSession())
+ //{
+ // using (var transaction = session.BeginTransaction())
+ // {
+ // var merdacz = new User("merdacz");
+ // var admin = new User("admin");
+ // session.Save(merdacz);
+ // session.Save(admin);
+ // transaction.Commit();
+ // }
+ //}
+
+ using (var session = factory.OpenSession())
+ {
+ using (var transaction = session.BeginTransaction())
+ {
+ ////var user = session.CreateCriteria<User>().UniqueResult();
+ Task alias;
+ var projects = session.CreateCriteria<Project>()
+ .SetFetchMode<Project>(x => x.Tasks, FetchMode.Join)
+ .List<Project>();
+
+//// var projects =
+//// session.CreateQuery(
+////"from Project as p inner join fetch p.Tasks as t inner join fetch t.RegisteredWork inner join fetch t.Tasks as tt inner join fetch tt.RegisteredWork")
+//// .List<Project>();
+
+
+ foreach (var project in projects)
+ {
+ var workProgressVisitor = new WorkProgressVisitor();
+ project.AcceptVisitor(workProgressVisitor);
+ }
+
+ transaction.Commit();
+ }
+ }
+
LogManager.Shutdown();
+ Console.ReadLine();
}
}
}
View
2  Source/Net.Daczkowski.Emineo.App/ProjectQueries.cs
@@ -26,7 +26,7 @@ public static void QueriesLazy()
using (var transaction = session.BeginTransaction())
{
var projects = session.CreateCriteria<Project>()
- .SetFetchMode("Tasks", FetchMode.Join)
+ //.SetFetchMode("Tasks", FetchMode.Join)
.List<Project>();
foreach (var project in projects)
View
10 Source/Net.Daczkowski.Emineo.Model/User.cs
@@ -25,16 +25,6 @@ public User(string name)
public virtual bool IsAuthenticated { get; protected set; }
- public virtual string A { get; protected set; }
-
- public virtual string B { get; protected set; }
-
- public virtual string C { get; protected set; }
-
- public virtual string D { get; protected set; }
-
- public virtual string E { get; protected set; }
-
public virtual void Authenticate(string password)
{
Contract.Requires(password != null);
View
8 Source/Net.Daczkowski.Emineo.Model/User.hbm.xml
@@ -2,16 +2,12 @@
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Net.Daczkowski.Emineo.Model"
namespace="Net.Daczkowski.Emineo.Model">
- <class name="User" table="Users" dynamic-insert="true" dynamic-update="true">
- <cache usage="read-write"/>
+ <class name="User" table="Users">
+ <!--<cache usage="read-write"/>-->
<id name="ID">
<generator class="identity" />
</id>
<property name="Name" not-null="true" />
<property name="LastLogin" />
- <property name="A" />
- <property name="B" />
- <property name="C" />
- <property name="D" />
</class>
</hibernate-mapping>

No commit comments for this range

Something went wrong with that request. Please try again.