Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
259 commits
Select commit Hold shift + click to select a range
0a45c6a
* STATUS (r2488): Nominate.
Oct 5, 2006
8dcdd47
* STATUS (r2498): Nominate.
Oct 5, 2006
375555a
* STATUS (r2500): Nominate.
Oct 5, 2006
702da7c
* STATUS (r2503): Nominate.
Oct 5, 2006
d327dee
* STATUS (r2504): Nominate.
Oct 5, 2006
7489659
* STATUS (r2505): Nominate.
Oct 5, 2006
1b5ad2c
* STATUS (r2506,r2514): Nominate.
Oct 5, 2006
a6a2477
* STATUS (r2512): Nominate.
Oct 5, 2006
0606c0f
* STATUS (r2538): Nominate.
Oct 5, 2006
9b0ad23
TODO List updated
Oct 6, 2006
e188185
Anakia improvements
Oct 6, 2006
1e07c43
Started ndoctransform task
Oct 6, 2006
85e86e6
* STATUS (r2551): Nominate.
Oct 6, 2006
14c3479
* STATUS (r2504): Nomination modified because it needs r2543
Oct 6, 2006
9ee4a71
Fixing test cases
Oct 6, 2006
2bd96ce
Added NDocTransformTask that generate xml docs (in castle site format…
Oct 6, 2006
e366427
Merged attributes documentation
Oct 7, 2006
b9231f3
Removed ref to IEntity
Oct 7, 2006
444ded5
Support for method documentation
Oct 7, 2006
6a56c87
Documented MR attributes. This need to be merged back to the trunk
Oct 7, 2006
5e648e2
Updated zipsamples-for-website
Oct 7, 2006
0e831d1
Recorded merge of revisions 2574-2576 via svnmerge from
Oct 8, 2006
f783340
* STATUS (r2572,r2573): Nominate.
Oct 9, 2006
1ae2605
* STATUS (r2600,r2601): Nominate.
Oct 9, 2006
7015d55
* STATUS (r2603): Nominate.
Oct 9, 2006
01d933b
AssemblyInfo.cs is generated and should not be in SVN.
Oct 9, 2006
ac36e97
Support for interfaces
Oct 9, 2006
130bc3c
Added documentation to Controller members
Oct 9, 2006
9d4c29e
Added documentation to ViewComponent
Oct 9, 2006
0e88aec
- Changed MonoRailContainer to save the configuration. On mono
Oct 10, 2006
4dee23c
Updated sample to use FormHelper and demonstrate conditional steps
Oct 11, 2006
eaa1e0c
- Started reviewing the wizard implementation
Oct 11, 2006
a3a153e
Renamed solution and project files
Oct 11, 2006
e8246f3
Added VS 2005 files
Oct 11, 2006
ba569d8
Ignore list updated
Oct 11, 2006
e6c6976
Added Josh Robb to the list
Oct 11, 2006
dd21e4b
Added another sample zip
Oct 11, 2006
e5fa3a1
- Started refactoring ARScaffold to rely on FormHelper
Oct 11, 2006
4ec848a
Added Scaffold support back to the build
Oct 11, 2006
4910f39
My votes
Oct 12, 2006
ed37709
Adding my votes to the STATUS.txt
Oct 12, 2006
8f59de7
merged documentation addition (two parameters documented, minor change)
Oct 12, 2006
24ff768
Commited my votes.
Oct 12, 2006
eb63ee9
adding my votes to STATUS.txt
Oct 12, 2006
1664842
r2488 was also fixed on the branch
Oct 12, 2006
e2c9485
Approving issues with at least 3 votes.
Oct 12, 2006
4845e39
Now ProgName and CLSID are different depending on the compilation pla…
Oct 12, 2006
612387d
VS.Net Wizards: Moved template folder
Oct 12, 2006
c488ef0
Reverted last commit (bad programmer!)
Oct 12, 2006
c78e07b
VS.Net Wizards: Moved template folder
Oct 12, 2006
6ef2b0b
Merged revisions 2498 via svnmerge from
Oct 12, 2006
4fa3a15
Merged revisions 2503 via svnmerge from
Oct 12, 2006
2b956b6
Merged revisions 2506,2514 via svnmerge from
Oct 12, 2006
3ae9e2f
Merged revisions 2551 via svnmerge from
Oct 12, 2006
bb3e266
Merged revisions 2600-2601 via svnmerge from
Oct 12, 2006
328a3cf
Merged revisions 2603 via svnmerge from
Oct 12, 2006
e23e21d
Moved files that were on CSharp folder to new AR folder
Oct 12, 2006
d2f1501
Now that progids are different, we need a vsz file for each. The setu…
Oct 12, 2006
c933b97
Blocked revisions 2500 via svnmerge
Oct 12, 2006
c64ab4c
Blocked revisions 2504,2543 via svnmerge
Oct 12, 2006
b7c6f56
- Added justification for r2512.
Oct 12, 2006
27bf5cd
Updated AR Templates to new libraries (Castle.Core)
Oct 12, 2006
321ec39
- Wizards fully updated.
Oct 13, 2006
a49c70e
Added wizard to the tools.build
Oct 13, 2006
4285612
Changed vote on r2505
Oct 13, 2006
eb0711f
Merged revisions 2572-2573 via svnmerge from
Oct 13, 2006
dfa3af5
Changed build. Now we attempt to get devenv from the environment, if …
Oct 13, 2006
de07f52
- New build script for Wix
Oct 13, 2006
0ac0677
Due to a apparent limitation with VS2003 being unable to load dlls de…
Oct 13, 2006
3033177
Change ComVisible to false, added ComVisible(true) only to the types …
Oct 13, 2006
75fbd32
- Added script set to include project resources (resx)
Oct 13, 2006
3f3d611
Ignore list updated
Oct 13, 2006
9b40f3c
- Fixed Wizard installation procedures
Oct 14, 2006
7016999
Merged changes to anakia (which shouldn't have been made on the trunk…
Oct 14, 2006
a422ff8
Small fix: Code was trying to fix setup event on null test project. A…
Oct 14, 2006
b6da3cc
Nasty bug which enabled windsor integration even when the attribute v…
Oct 14, 2006
5466ced
- Fixes to make it work with VS 2005
Oct 14, 2006
1e801d9
Added two MonoRail samples: simple databinding and DataBind attribute…
Oct 14, 2006
7716aa5
Ignore list updated
Oct 14, 2006
c902a50
antlr.runtime.dll was missing on the branch although the r2601 was me…
Oct 14, 2006
0c92710
small fix: wrong monorail configuration was being generated.
Oct 14, 2006
8de74bb
Sample on how to send emails
Oct 15, 2006
fb9b210
Ignore list updated
Oct 15, 2006
d625c89
ViewComponents Sample
Oct 15, 2006
c83cc03
More improvements on error handling
Oct 15, 2006
4a47292
added more samples to 'zip samples for web site' task
Oct 15, 2006
262f965
Vote on the candidate changes.
Oct 15, 2006
d9768ca
Two authentication samples
Oct 15, 2006
9c26bbe
Included samples to zip
Oct 15, 2006
d521d77
Ignore list updated
Oct 15, 2006
77953b9
Localization sample for MR
Oct 15, 2006
f66802d
Minor updates to Movies Samples
Oct 15, 2006
c734a27
Sample updated
Oct 15, 2006
c5f06dc
Minor change
Oct 15, 2006
0655402
Added aspx page to do the first redirect
Oct 15, 2006
b40d425
Added documentation
Oct 15, 2006
6093e8a
Enclosed doc example code with <code> tag
Oct 15, 2006
ea8780d
Improved wizard. Added default rescues and layout.
Oct 16, 2006
dd93d05
Implemented missing features
Oct 16, 2006
8ba8bf6
Added informative error message
Oct 16, 2006
24d02f0
Updated Bin.wxs with list created by heat.exe
Oct 16, 2006
e43d22e
Missing files added
Oct 16, 2006
0ccce05
MonoRail/ActiveRecord integration sample (ARDataBind/ARFetch)
Oct 16, 2006
2aa311d
Ignore list updated
Oct 16, 2006
ab38ed9
Updated status.
Oct 16, 2006
35ae92e
- Added test case for User class
Oct 16, 2006
1034d75
sample related tasks updated
Oct 16, 2006
6d94485
Ignore list updated
Oct 16, 2006
755e32d
Applied changes on the wiz setup and fix on the MonoRailProjectWizard
Oct 16, 2006
b660f81
Supplied documentation for the helper
Oct 17, 2006
8853a82
- r2505 approved
Oct 17, 2006
9425841
- ARDataBinder was ovewriting ids on belongs to relations causing
Oct 17, 2006
1d1de97
Minor fixes on the wizard and templates
Oct 18, 2006
118cf06
FormHelper sample project
Oct 18, 2006
a0a3c52
Added code documentation
Oct 18, 2006
7bd4778
Improvements:
Oct 18, 2006
568c815
Merged revisions 2505 via svnmerge from
Oct 18, 2006
aeb8d25
Updated STATUS.txt.
Oct 18, 2006
4cd9650
Documentation fixes
Oct 19, 2006
1babe26
Update zip-samples-for-website task
Oct 19, 2006
97c474e
Minor documentation and style changes
Oct 19, 2006
4400157
Added my last bug fix on SMTP email sending component as a candidate …
Oct 19, 2006
0d70e55
Another proposal.
Oct 19, 2006
cc8133c
Woops.
Oct 19, 2006
5a7d6f4
Added support to events
Oct 22, 2006
e62778a
Added documentation
Oct 22, 2006
d76e026
Container sample (Small time tracking application)
Oct 22, 2006
e39d4c3
Included type converter sample
Oct 23, 2006
bd6a9cf
Include new samples
Oct 23, 2006
5c385ed
- Added setter to ReleasePolicy property
Oct 24, 2006
48c1ffa
Votes and removed merged r2505 block
Oct 24, 2006
461bb02
* STATUS (r2787,2791): Nominate.
Oct 24, 2006
c23aec0
Merged revisions 2538 via svnmerge from
Oct 24, 2006
f001f7f
- Made the DependencyModel.IsOptional property writable
Oct 25, 2006
183c9a4
Renamed test case
Oct 25, 2006
b690030
- Added ExtendingSample2
Oct 25, 2006
fe55f4b
Ignore list updated
Oct 25, 2006
bec90da
STATUS.txt updated.
Oct 25, 2006
b8e7ff6
- Added xml documentation
Oct 25, 2006
3d0878d
Fixed implementation
Oct 25, 2006
6753fa4
Added one more sample zip file generation
Oct 26, 2006
bb69926
- Applied patch by aledeniz <alessandro.riolo@gmail.com> fixing locat…
Oct 26, 2006
aba3ae8
Simplified code
Oct 26, 2006
b3378a2
Attempt to fix bug reported on forum: TestContext is not being popula…
Oct 26, 2006
32a59c1
Defined that debug models will be generated on the AppDomain base dir…
Oct 27, 2006
37ed3c2
- Added FindByPropertyInfo to PropertySetCollection
Oct 27, 2006
be95fd9
Added more logging calls
Oct 27, 2006
2de63b3
Style and name convention names
Oct 27, 2006
4480de7
- Style changes
Oct 27, 2006
a5aa41b
Fix for Brail projects as suggest on the devel list
Oct 27, 2006
a6f62e2
Applied patch by Robert Hencke <akidan@gmail.com> adding the required…
Oct 27, 2006
eac426e
Now the conditions are fixed
Oct 27, 2006
4cdbf65
Changed name of mapping files generated when isDebug=true. They now f…
Oct 27, 2006
b69ba40
- Form helper small fix
Oct 27, 2006
e2cc172
Fixed form helper problem for good. Strings are enumerable, this was …
Oct 27, 2006
bc19883
This sample could not work in any way. It uses things that the Remoti…
Oct 28, 2006
58770a4
Resurrected facility test cases that were deleted by roelof (r2449) f…
Oct 28, 2006
2993e2a
Remoting Facility samples
Oct 28, 2006
e3de75c
Ignore list update
Oct 28, 2006
f936ead
STATUS.txt updated.
Oct 28, 2006
8d265b9
Updated projects
Oct 29, 2006
7517081
Added code documentation
Oct 29, 2006
8a81ff2
- Fixed MonoRailProjectWizard to include Routing module on Web.config
Oct 29, 2006
df2ac7a
Updated setup to match the new folder structure for VS 2005 MonoRail …
Oct 29, 2006
013ec7b
Fixed directory location
Oct 29, 2006
a5f4fe3
Blog sample improved
Oct 30, 2006
4065bf9
r2677, r2770 and r2771 have enough votes to be merged in from trunk.
Oct 30, 2006
dfb122e
- Added sample for "Getting Started" section
Oct 30, 2006
465d57b
My votes
Oct 30, 2006
cd597a9
Approved some changes
Oct 31, 2006
4051d2a
Merged revisions 2546 via svnmerge from
Oct 31, 2006
6b6ec94
Merged revisions 2622,2624-2625,2628-2640,2642,2646,2648,2650-2669,26…
Oct 31, 2006
614a18e
Merged revisions 2770 via svnmerge from
Oct 31, 2006
3eee1c8
Merged revisions 2771 via svnmerge from
Oct 31, 2006
78e3e26
Removed commited changes from STATUS.txt
Oct 31, 2006
810e753
Added sample
Oct 31, 2006
8cc2d98
Added sample to build
Oct 31, 2006
b8d0534
Setup now includes documentation
Oct 31, 2006
445ee7f
* STATUS (2623,2778,2780) Blocked and removed because they are vetoed
Nov 3, 2006
d9ed6f9
More votes from me.
Nov 3, 2006
b982fa7
Added vs2005 solution file and project file
Nov 8, 2006
cffc55d
Merged revisions 2787,2791,2814,2840 via svnmerge from
Nov 13, 2006
bdeec83
Reapplied bugtraq:* properties.
Nov 17, 2006
777b11c
Applied patch by Alessandro Riolo to upgrade NHibernate to version 1.0.4
Feb 13, 2007
6e994b9
Merged revisions 2512,2515-2526,2528-2537,2539-2542,2544-2545,2547-25…
Sep 4, 2007
6fc973d
Merged revisions 2568-2571,2577 via svnmerge from
Sep 4, 2007
3f47c74
Merged revisions 2592-2596 via svnmerge from
Sep 4, 2007
22a0dec
Merged revisions 2602,2604-2621,2624-2641 via svnmerge from
Sep 4, 2007
271377e
Merged revisions 2643,2645-2649 via svnmerge from
Sep 4, 2007
0bc50bc
Merged revisions 2670-2672,2674,2676,2678-2703,2705-2707 via svnmerge…
Sep 4, 2007
30b270e
Merged revisions 2709-2753 via svnmerge from
Sep 4, 2007
278de80
Merged revisions 2762-2769,2772-2777,2779,2781-2786,2788-2790 via svn…
Sep 4, 2007
80bdfcf
Merged revisions 2795-2813,2815-2830 via svnmerge from
Sep 4, 2007
f25c4d6
Merged revisions 2851-2869,2871-2893,2895-2901 via svnmerge from
Sep 4, 2007
b2e0b77
Merged revisions 2904-2923 via svnmerge from
Sep 5, 2007
8893557
Merged revisions 2924-2941 via svnmerge from
Sep 5, 2007
60f0917
Merged revisions 2944-2962 via svnmerge from
Sep 5, 2007
739f1e0
Merged revisions 2964-2966 via svnmerge from
Sep 5, 2007
b49e0ed
Merged revisions 2969-2973 via svnmerge from
Sep 5, 2007
4aa2af9
Merged revisions 2977-2988 via svnmerge from
Sep 5, 2007
e9f2ee9
Merged revisions 2990-3041 via svnmerge from
Sep 5, 2007
a833799
Merged revisions 3043-3057 via svnmerge from
Sep 5, 2007
137b844
Merged revisions 3059-3067 via svnmerge from
Sep 5, 2007
08aa0f3
Merged revisions 3069-3092 via svnmerge from
Sep 6, 2007
4288556
Merged revisions 3094-3106 via svnmerge from
Sep 6, 2007
a2f6edf
Merged revisions 3108-3116 via svnmerge from
Sep 6, 2007
23a7795
Merged revisions 3120-3132 via svnmerge from
Sep 6, 2007
b327e14
Merged revisions 3134-3179 via svnmerge from
Sep 6, 2007
b7246be
Merged revisions 3182-3202 via svnmerge from
Sep 6, 2007
b42498d
Merged revisions 3204-3214 via svnmerge from
Sep 7, 2007
e8861b3
Merged revisions 3215 via svnmerge from
Sep 10, 2007
9094c43
Merged revisions 3216-3219 via svnmerge from
Sep 10, 2007
159e309
Merged revisions 3221-3240 via svnmerge from
Sep 10, 2007
7c7fa9f
Merged revisions 3245-3266 via svnmerge from
Sep 10, 2007
9f86bde
Merged revisions 3268-3309 via svnmerge from
Sep 10, 2007
a6817e2
Merged revisions 3312-3328 via svnmerge from
Sep 10, 2007
0d83b0e
Merged revisions 3330-3331 via svnmerge from
Sep 10, 2007
9be44fd
Merged revisions 3333-3348 via svnmerge from
Sep 10, 2007
9d0ba5a
Merged revisions 3351-3380 via svnmerge from
Sep 10, 2007
9ae160b
Merged revisions 3383-3416 via svnmerge from
Sep 10, 2007
36a4b73
Merged revisions 3532-3589 via svnmerge from
Sep 10, 2007
2130117
Merged revisions 2831 via svnmerge from
Sep 10, 2007
783f48a
Unblocked revisions 2500 via svnmerge
Sep 11, 2007
260abc3
Reverted to r3541
Sep 11, 2007
1c6adaf
Reverted to r2879
Sep 13, 2007
4447044
New 1.0.x release branch.
Sep 15, 2007
bfaabec
Initialized merge tracking via "svnmerge" with revisions "1-4284" from
Sep 16, 2007
4776436
Reset project.version to 1.0.0.0 (like in previous 1.0.x branch)
Sep 16, 2007
92d565b
* Changed UpgradeGuid to value as in previous 1.0.x branch.
Sep 16, 2007
026a13f
Blocked revisions 4302 via svnmerge
Sep 17, 2007
8f0703d
Blocked revisions 4292 via svnmerge
Sep 17, 2007
eebfbd7
Merged revisions 4285-4291,4293-4301,4303-4306 via svnmerge from
Sep 17, 2007
c1139cc
Merged revisions 4303-4304,4307-4308 via svnmerge from
Sep 17, 2007
160a109
Merged revisions 4311-4313 via svnmerge from
Sep 18, 2007
ea913db
Merged revisions 4316 via svnmerge from
Sep 18, 2007
1342963
Merged revisions 4318 via svnmerge from
Sep 18, 2007
39c12c0
Merged revisions 4303-4304,4307,4309-4310,4314-4315,4317,4319-4325 vi…
Sep 20, 2007
e5b76ef
Merged revisions 4327-4332 via svnmerge from
Sep 20, 2007
63f2616
Merged revisions 4338 via svnmerge from
Sep 21, 2007
c0be478
Merged revisions 4338 via svnmerge from
Sep 21, 2007
00e08fe
Merged revisions 4340 via svnmerge from
Sep 21, 2007
30bf087
Merged revisions 4340 via svnmerge from
Sep 21, 2007
7b6101a
Merged revisions 4344 via svnmerge from
Sep 21, 2007
3289adc
Merged revisions 4346 via svnmerge from
Sep 21, 2007
14eac54
Merged revisions 4303-4304,4307,4309,4315,4317,4319,4326,4333-4337,43…
Sep 26, 2007
399b516
Merged revisions 4388 via svnmerge from
Oct 12, 2007
2968090
Merged revisions 4356-4377 via svnmerge from
Oct 12, 2007
5d54346
Merged revisions 4383-4387 via svnmerge from
Oct 12, 2007
13f9f03
Merged revisions 4419 via svnmerge from
Oct 18, 2007
551453e
Merged revisions 4393-4409,4411-4415 via svnmerge from
Oct 18, 2007
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<include buildfile="${root.dir}/common-project.xml" />

<target name="init" depends="common.init">
<property name="assembly.version" value="1.0.0.0" />
<property name="assembly.version" value="1.0.3.0" />
<property name="assembly.sign" value="false" />

<assemblyfileset id="project.references" basedir="${build.dir}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ public void JoinedSubClassUseWithGenericTypeAndGenericAbstractBase()
String expected =
"<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n" +
"<hibernate-mapping auto-import=\"true\" default-lazy=\"false\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"urn:nhibernate-mapping-2.2\">\r\n" +
" <class name=\"Castle.ActiveRecord.Framework.Internal.Tests.Model.GenBaseJoinedClass`1[[Castle.ActiveRecord.Framework.Internal.Tests.Model.GenSubClassJoinedClass, Castle.ActiveRecord.Framework.Internal.Tests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Castle.ActiveRecord.Framework.Internal.Tests\" table=\"disctable\">\r\n" +
" <class name=\"Castle.ActiveRecord.Framework.Internal.Tests.Model.GenBaseJoinedClass`1[[Castle.ActiveRecord.Framework.Internal.Tests.Model.GenSubClassJoinedClass, Castle.ActiveRecord.Framework.Internal.Tests, Version=1.0.3.0, Culture=neutral, PublicKeyToken=null]], Castle.ActiveRecord.Framework.Internal.Tests\" table=\"disctable\">\r\n" +
" <id name=\"Id\" access=\"property\" column=\"Id\" type=\"Int32\" unsaved-value=\"0\">\r\n" +
" <generator class=\"native\">\r\n" +
" </generator>\r\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
<ItemGroup>
<Compile Include="AnyRelationTestCase.cs" />
<Compile Include="CompositeUserTypeTestCase.cs" />
<Compile Include="InvalidRootTypeTestCase.cs" />
<Compile Include="Model\ClassWithBrokenField.cs" />
<Compile Include="Model\Ship.cs" />
<Compile Include="VerifyModelsAgainstDBSchemaTestCase.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<include buildfile="${root.dir}/common-project.xml" />

<target name="init" depends="common.init">
<property name="assembly.version" value="1.0.0.0" />
<property name="assembly.version" value="1.0.3.0" />
<property name="assembly.sign" value="false" />
<property name="assembly.is-cls-compliant" value="false" />

Expand Down
55 changes: 55 additions & 0 deletions ActiveRecord/Castle.ActiveRecord.Tests/InvalidRootTypeTestCase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright 2004-2006 Castle Project - http://www.castleproject.org/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Castle.ActiveRecord.Tests
{
using System.Collections;
using Castle.ActiveRecord.Framework;
using Castle.ActiveRecord.Framework.Config;
using NUnit.Framework;

[TestFixture]
public class InvalidRootTypeTestCase
{
protected IConfigurationSource GetConfigSource()
{
InPlaceConfigurationSource source = new InPlaceConfigurationSource();

Hashtable properties = new Hashtable();
properties.Add("hibernate.connection.driver_class", "NHibernate.Driver.SqlClientDriver");
properties.Add("hibernate.dialect", "NHibernate.Dialect.MsSql2000Dialect");
properties.Add("hibernate.connection.provider", "NHibernate.Connection.DriverConnectionProvider");
properties.Add("hibernate.connection.connection_string",
"Data Source=.;Initial Catalog=test;Integrated Security=SSPI");

source.Add(typeof(ActiveRecordBase), properties);
source.Add(typeof(NonAbstractRootType), properties);

return source;
}

[Test, ExpectedException(typeof(ActiveRecordException))]
public void RootTypeIsNotAbstract()
{
ActiveRecordStarter.ResetInitializationFlag();

ActiveRecordStarter.Initialize(GetConfigSource(),
typeof(NonAbstractRootType));
}

public class NonAbstractRootType : ActiveRecordBase
{
}
}
}
26 changes: 26 additions & 0 deletions ActiveRecord/Castle.ActiveRecord.Tests/JoinedSubClassTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,31 @@ public void Entities()
Assert.AreEqual( ce.Name, ces[0].Name );
Assert.AreEqual( ce.Id, ces[0].Id );
}

[Test]
public void JoinedSubClass_WithAnyProperty()
{
ActiveRecordStarter.Initialize(GetConfigSource(),
typeof(Entity), typeof(CompanyEntity), typeof(PersonEntity), typeof(ManagerEntity));
Recreate();

Entity.DeleteAll();
CompanyEntity.DeleteAll();
PersonEntity.DeleteAll();
ManagerEntity.DeleteAll();

ManagerEntity manager = new ManagerEntity();
manager.Name = "pointy haired";
manager.Save();

PersonEntity person = new PersonEntity();
person.Name = "dilbert";
person.Manager = manager;
person.Save();

PersonEntity[] people = PersonEntity.FindAll();
Assert.AreEqual(1, people.Length);
Assert.IsNotNull(people[0].Manager);
}
}
}
53 changes: 53 additions & 0 deletions ActiveRecord/Castle.ActiveRecord.Tests/Model/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ public int Person_Id
set { person_id = value; }
}

private IManager manager;

[Any(IdType = typeof(int), MetaType = typeof(string), IdColumn = "ManagerId", TypeColumn = "ManagerType")]
[Any.MetaValueAttribute("Manager", typeof(ManagerEntity))]
public virtual IManager Manager
{
get { return manager; }
set { manager = value; }
}

public new static void DeleteAll()
{
ActiveRecordBase.DeleteAll( typeof(PersonEntity) );
Expand All @@ -127,4 +137,47 @@ public int Person_Id
return (PersonEntity) ActiveRecordBase.FindByPrimaryKey( typeof(PersonEntity), id );
}
}

[ActiveRecord("entitymanager")]
public class ManagerEntity : ActiveRecordBase, IManager
{
private int id;

[PrimaryKey]
public int Id
{
get { return id; }
set { id = value; }
}

private string name;

[Property]
public virtual string Name
{
get { return name; }
set { name = value; }
}

public static void DeleteAll()
{
DeleteAll(typeof(ManagerEntity));
}

public static ManagerEntity[] FindAll()
{
return (ManagerEntity[])FindAll(typeof(ManagerEntity));
}

public static ManagerEntity Find(int id)
{
return (ManagerEntity)FindByPrimaryKey(typeof(ManagerEntity), id);
}
}

public interface IManager
{
int Id { get; set; }
string Name { get; set; }
}
}
13 changes: 13 additions & 0 deletions ActiveRecord/Castle.ActiveRecord/Attributes/BelongsToAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public class BelongsToAttribute : WithAccessAttribute
private bool insert = true;
private bool notnull;
private bool unique;
private String propertyRef;
private FetchEnum fetchMethod = FetchEnum.Unspecified;
private CascadeEnum cascade = CascadeEnum.None;
private NotFoundBehaviour notFoundBehaviour = NotFoundBehaviour.Default;
Expand Down Expand Up @@ -182,6 +183,18 @@ public FetchEnum Fetch
set { fetchMethod = value; }
}

/// <summary>
/// From NHibernate docs: The name of a property of the
/// associated class that is joined to the primary key
/// of this class. If not specified, the primary key of
/// the associated class is used.
/// </summary>
public string PropertyRef
{
get { return propertyRef; }
set { propertyRef = value; }
}

/// <summary>
/// Set to <c>false</c> to ignore this association when updating entities of this ActiveRecord class.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion ActiveRecord/Castle.ActiveRecord/Castle.ActiveRecord.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<target name="init" depends="common.init">
<property name="build.warnmissingdocs" value="true" />
<property name="assembly.version" value="0.0.1.3" />
<property name="assembly.version" value="1.0.3.0" />
<property name="assembly.description" value="An implementation of the ActiveRecord pattern for .NET" />

<assemblyfileset id="project.references" basedir="${build.dir}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ActiveRecordMediator<T> : ActiveRecordMediator where T : class
/// <returns>Whatever is returned by the delegate invocation</returns>
public static object Execute(NHibernateDelegate call, T instance)
{
return ActiveRecordMediator.Execute(typeof(T), call, instance);
return Execute(typeof(T), call, instance);
}

/// <summary>
Expand Down Expand Up @@ -96,7 +96,7 @@ public static T FindFirst(DetachedCriteria detachedCriteria, params Order[] orde
/// <returns>A <c>targetType</c> instance or <c>null</c></returns>
public static T FindFirst(DetachedCriteria criteria)
{
return (T)FindFirst(typeof(T),criteria);
return (T) FindFirst(typeof(T),criteria);
}

/// <summary>
Expand All @@ -117,7 +117,7 @@ public static T FindOne(params ICriterion[] criterias)
/// <returns>A <c>targetType</c> instance or <c>null</c></returns>
public static T FindOne(DetachedCriteria criteria)
{
return (T)FindOne(typeof(T), criteria);
return (T) FindOne(typeof(T), criteria);
}

/// <summary>
Expand All @@ -138,7 +138,7 @@ public static T[] FindAll()
/// <returns></returns>
public static T[] FindAll(Order[] orders, params ICriterion[] criterias)
{
return (T[])FindAll(typeof(T), orders, criterias);
return (T[]) FindAll(typeof(T), orders, criterias);
}

/// <summary>
Expand All @@ -149,15 +149,15 @@ public static T[] FindAll(Order[] orders, params ICriterion[] criterias)
/// <returns></returns>
public static T[] FindAll(params ICriterion[] criterias)
{
return (T[])FindAll(typeof(T), criterias);
return (T[]) FindAll(typeof(T), criterias);
}

/// <summary>
/// Returns all instances found for the specified type according to the criteria
/// </summary>
public static T[] FindAll(DetachedCriteria detachedCriteria, params Order[] orders)
{
return (T[])FindAll(typeof(T), detachedCriteria, orders);
return (T[]) FindAll(typeof(T), detachedCriteria, orders);
}

/// <summary>
Expand All @@ -179,10 +179,9 @@ public static T[] SlicedFindAll(int firstResult, int maxResults, params ICriteri
/// <summary>
/// Returns a portion of the query results (sliced)
/// </summary>
public static T[] SlicedFindAll(int firstResult, int maxResults,
DetachedCriteria criteria)
public static T[] SlicedFindAll(int firstResult, int maxResults, DetachedCriteria criteria, params Order[] orders)
{
return (T[])SlicedFindAll(typeof(T), firstResult, maxResults, criteria);
return (T[]) SlicedFindAll(typeof(T), firstResult, maxResults, orders, criteria);
}

/// <summary>
Expand Down
26 changes: 20 additions & 6 deletions ActiveRecord/Castle.ActiveRecord/Framework/ActiveRecordStarter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,21 @@ private static ActiveRecordModelCollection BuildModels(ISessionFactoryHolder hol
throw new ActiveRecordException(
String.Format("Type `{0}` is registered already", type.FullName));
}
}
else if (TypeDefinesADatabaseBoundary(type))
}
else if (IsConfiguredAsRootType(type))
{
SetUpConfiguration(source, type, holder);

continue;
if (TypeDefinesADatabaseBoundary(type))
{
SetUpConfiguration(source, type, holder);
continue;
}
else
{
throw new ActiveRecordException(
string.Format(
"Type `{0}` is not a valid root type. Make sure it is abstract and inherits from ActiveRecordBase.",
type.FullName));
}
}
else if (!IsActiveRecordType(type))
{
Expand Down Expand Up @@ -480,6 +489,11 @@ private static ActiveRecordModelCollection BuildModels(ISessionFactoryHolder hol
return models;
}

private static bool IsConfiguredAsRootType(Type type)
{
return configSource.GetConfiguration(type) != null;
}

private static bool TypeDefinesADatabaseBoundary(Type type)
{
return (type.IsAbstract && !IsTypeHierarchyBase(type));
Expand Down Expand Up @@ -777,7 +791,7 @@ private static void CollectValidActiveRecordTypesFromAssembly(Assembly assembly,
/// <param name="originalFileName"></param>
/// <param name="fileCount"></param>
/// <returns></returns>
public static string CreateAnotherFile(string originalFileName, int fileCount)
private static string CreateAnotherFile(string originalFileName, int fileCount)
{
string path = Path.GetDirectoryName(originalFileName);
string fileName = Path.GetFileNameWithoutExtension(originalFileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,13 @@ private static IConfiguration ConvertToConfiguration(IDictionary properties)
/// <param name="config">The configuration</param>
private static void ProcessConfiguration(IConfiguration config)
{
const string ConnectionStringKey = "hibernate.connection.connection_string";
const string ConnectionStringKey = "connection.connection_string";

for(int i = 0; i < config.Children.Count; ++i)
{
IConfiguration property = config.Children[i];

if (property.Name == ConnectionStringKey)
if (property.Name.IndexOf(ConnectionStringKey) >= 0)
{
String value = property.Value;
Regex connectionStringRegex = new Regex(@"ConnectionString\s*=\s*\$\{(?<ConnectionStringName>[^}]+)\}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ protected void PopulateSource(XmlNode section)

SetUpNamingStrategyType(namingStrategyTypeAtt != null ? namingStrategyTypeAtt.Value : String.Empty);

SetDebugFlag(isDebug != null && "true" == isDebug.Value);
SetDebugFlag(ConvertBool(isDebug));

SetIsLazyByDefault(lazyByDefault != null && lazyByDefault.Value == "true");
SetIsLazyByDefault(ConvertBool(lazyByDefault));

SetPluralizeTableNames(pluralize != null && pluralize.Value == "true");
SetPluralizeTableNames(ConvertBool(pluralize));

SetVerifyModelsAgainstDBSchema(verifyModelsAgainstDBSchemaAtt != null && verifyModelsAgainstDBSchemaAtt.Value == "true");

Expand Down Expand Up @@ -178,5 +178,10 @@ protected IDictionary BuildProperties(XmlNode node)

return dict;
}

private static bool ConvertBool(XmlNode boolAttrib)
{
return boolAttrib != null && "true".Equals(boolAttrib.Value, StringComparison.OrdinalIgnoreCase);
}
}
}
Loading