├── .gitignore ├── Castle.ActiveRecord-vs2010.sln ├── Changes.txt ├── ClickToBuild.cmd ├── License.txt ├── README.md ├── Running the test cases.txt ├── Settings.proj ├── TODO.txt ├── build.cmd ├── buildscripts ├── ASL - Apache Software Foundation License.txt ├── Build.proj ├── Castle.Common.Targets ├── CastleKey.snk ├── Committers.txt ├── CommonAssemblyInfo.cs ├── NDependProject.xml ├── ReSharper5.CodingStyle.xml └── build.cmd ├── docs ├── README.md ├── accessing-more-than-one-database.md ├── best-practices.md ├── bytecode-generator.md ├── configuration-and-initialization.md ├── creating-an-activerecord-class.md ├── enabling-lazy-load.md ├── external-articles.md ├── faq.md ├── framework-events.md ├── getting-started.md ├── hooks-and-lifecycle.md ├── images │ └── castle-logo.png ├── markdownlint.rb ├── native-sql-queries.md ├── nested-data.md ├── persistency-lifecycle.md ├── primary-key-mapping.md ├── relations-mapping.md ├── schema-generation.md ├── simple-column-mapping.md ├── troubleshooting.md ├── tuning.md ├── type-hierarchy.md ├── understanding-scopes.md ├── unit-testing.md ├── using-hql.md ├── using-imports.md ├── using-scopes.md ├── using-the-activerecordmediator.md ├── using-version-and-timestamp.md ├── validation-support.md ├── validators.md ├── web-applications.md └── xml-configuration-reference.md ├── lib ├── Iesi.Collections.dll ├── Iesi.Collections.license.txt ├── Iesi.Collections.pdb ├── Iesi.Collections.xml ├── Lucene.Net.dll ├── Lucene.Net.pdb ├── NHibernate.ByteCode.Castle.dll ├── NHibernate.ByteCode.Castle.pdb ├── NHibernate.ByteCode.Castle.xml ├── NHibernate.Search.dll ├── NHibernate.Search.pdb ├── NHibernate.dll ├── NHibernate.license.txt ├── NHibernate.pdb ├── NHibernate.xml ├── mono-3.5 │ ├── Castle.Components.Validator.dll │ ├── Castle.Components.Validator.xml │ ├── Castle.Core.dll │ ├── Castle.Core.xml │ ├── Castle.DynamicProxy2.dll │ ├── Castle.DynamicProxy2.xml │ ├── MySql.Data.dll │ ├── log4net.dll │ ├── log4net.license.txt │ └── log4net.xml ├── net35 │ ├── Castle.Components.Validator.XML │ ├── Castle.Components.Validator.dll │ ├── Castle.Components.Validator.pdb │ ├── Castle.Core.dll │ ├── Castle.Core.pdb │ ├── Castle.Core.xml │ ├── System.Data.SQLite.DLL │ ├── log4net.dll │ ├── log4net.license.txt │ ├── log4net.xml │ └── x64 │ │ └── System.Data.SQLite.dll ├── net40 │ ├── Castle.Components.Validator.XML │ ├── Castle.Components.Validator.dll │ ├── Castle.Components.Validator.pdb │ ├── Castle.Core.dll │ ├── Castle.Core.pdb │ ├── Castle.Core.xml │ ├── System.Data.SQLite.DLL │ ├── log4net.dll │ ├── log4net.license.txt │ ├── log4net.xml │ └── x64 │ │ └── System.Data.SQLite.dll ├── nunit.framework.dll └── nunit.framework.license.txt ├── src ├── Castle.ActiveRecord.Framework.Internal.Tests │ ├── AbstractActiveRecordTest.cs │ ├── App.config │ ├── AssemblyAttributes.cs │ ├── AssemblyXmlGenerationTestCase.cs │ ├── Castle.ActiveRecord.Framework.Internal.Tests-vs2010.csproj │ ├── GraphConnectorTestCase.cs │ ├── ImportTestCase.cs │ ├── InflectorTestCase.cs │ ├── Model │ │ ├── BadCompositeKey.cs │ │ ├── BaseJoinedClass.cs │ │ ├── BelongsToClassA.cs │ │ ├── BelongsToWithFetch.cs │ │ ├── BelongsToWithLazy.cs │ │ ├── CacheClass.cs │ │ ├── Category.cs │ │ ├── ClassA.cs │ │ ├── ClassADynamicInsertUpdate.cs │ │ ├── ClassDiscriminatorLengthParent.cs │ │ ├── ClassDiscriminatorParent.cs │ │ ├── ClassJoinedSubClassParent.cs │ │ ├── ClassKeyAssigned.cs │ │ ├── ClassWithAnyAttribute.cs │ │ ├── ClassWithBadCompositeKey.cs │ │ ├── ClassWithBadMapping.cs │ │ ├── ClassWithCompositeKey.cs │ │ ├── ClassWithCustomPersister.cs │ │ ├── ClassWithElementList.cs │ │ ├── ClassWithExtraLazyOnHasMany.cs │ │ ├── ClassWithIndexOnHasMany.cs │ │ ├── ClassWithLazyBlobProperty.cs │ │ ├── ClassWithMappedField.cs │ │ ├── ClassWithMultiplePrimaryKeys.cs │ │ ├── ClassWithOptimisticLock.cs │ │ ├── ClassWithOverride.cs │ │ ├── ClassWithSchemaAction.cs │ │ ├── ClassWithSomeCustomOptions.cs │ │ ├── ClassWithTuplizer.cs │ │ ├── ClassWithoutPrimaryKey.cs │ │ ├── Company.cs │ │ ├── Component.cs │ │ ├── ComponentManyToClassA.cs │ │ ├── ComponentWithNested.cs │ │ ├── ComponentWithNested2LevelsDeep.cs │ │ ├── CompositeKeyForClassWithCompositeKey.cs │ │ ├── CompositeKeyModels.cs │ │ ├── DictionaryModel.cs │ │ ├── DiscriminatorGrandchild.cs │ │ ├── Employee.cs │ │ ├── EnumModel.cs │ │ ├── EnumTestClass.cs │ │ ├── GenBaseJoinedClass.cs │ │ ├── GenClassJoinedSubClassParent.cs │ │ ├── HasAndBelongsToClassA.cs │ │ ├── HasAndBelongsToManyWithBadList.cs │ │ ├── HasManyClassA.cs │ │ ├── HasManyDependentObjects.cs │ │ ├── HasManyDependentObjectsWithNested.cs │ │ ├── HasManyDependentObjectsWithNested2LevelsDeep.cs │ │ ├── HasManyToAnyWithBadList.cs │ │ ├── HasManyToManyViaComponents.cs │ │ ├── HasManyWithBadList.cs │ │ ├── HasManyWithBatch.cs │ │ ├── HasManyWithFetch.cs │ │ ├── IdBagPrimitive.cs │ │ ├── ImportClass.cs │ │ ├── JoinedSubClassWithPrimaryKey.cs │ │ ├── LazyClass.cs │ │ ├── LazyClassWithoutVirtualPropertyOnBelongsTo.cs │ │ ├── NotFoundBehaviourClass.cs │ │ ├── Person.cs │ │ ├── PropertyAccessHelperTests.cs │ │ ├── SequenceParamClass.cs │ │ ├── SimpleNestedComponent.cs │ │ ├── SimpleNestedComponentWithFieldAccess.cs │ │ ├── TimestampedClass.cs │ │ ├── Tuplizer.cs │ │ ├── VersionedClass.cs │ │ └── VersionedTimestampedClass.cs │ ├── SemanticCheckTestCase.cs │ └── XmlGenerationTestCase.cs ├── Castle.ActiveRecord.Tests.Model │ ├── ActiveRecordClass.cs │ ├── AttributedPreLoadListener.cs │ ├── Castle.ActiveRecord.Tests.Model-vs2010.csproj │ ├── NHibernateClass.cs │ ├── NonAttributedPreLoadListener.cs │ ├── Readme.txt │ └── RegisterNHibernateClassMapping.cs ├── Castle.ActiveRecord.Tests │ ├── AbstractActiveRecordTest.cs │ ├── ActiveRecordBaseGenericsTestCase.cs │ ├── ActiveRecordDetachedQueryGenericTestCase.cs │ ├── ActiveRecordDetachedQueryTestCase.cs │ ├── ActiveRecordGenericsTestCase.cs │ ├── ActiveRecordLinqTestCase.cs │ ├── ActiveRecordTestCase.cs │ ├── ActiveRecordWithoutBaseTestCase.cs │ ├── AnyRelationTestCase.cs │ ├── App-net-2.0.config │ ├── App-net-3.5.config │ ├── App.config │ ├── BugTestCase.cs │ ├── Bugs │ │ ├── ARIssue157TestCase.cs │ │ └── ARIssue293TestCase.cs │ ├── Castle.ActiveRecord.Tests-vs2010.csproj │ ├── CompositeNestedClassTestCase.cs │ ├── CompositeUserTypeTestCase.cs │ ├── Config │ │ ├── AspNet2.0ConfigurationIntegration.cs │ │ ├── ConfigurationSource.cs │ │ ├── ConfigureTests.cs │ │ └── StorageConfigurationTests.cs │ ├── Conversation │ │ ├── ConversationScenarioTest.cs │ │ └── ScopedConversationTests.cs │ ├── CountQueryTestCase.cs │ ├── DefaultConfigurationsTestCase.cs │ ├── DifferentDatabaseScopeTestCase.cs │ ├── EnumModelTestCase.cs │ ├── Event │ │ ├── AbstractEventListenerTest.cs │ │ ├── AssemblyAttributesTest.cs │ │ ├── ContributorTest.cs │ │ ├── EventListenerAttributeTest.cs │ │ ├── EventListenerContributionTest.cs │ │ └── NHEventListenersTest.cs │ ├── FetchTestCase.cs │ ├── GenericJoinedSubClassTestCase.cs │ ├── IntegrationWithNHibernateTestCase.cs │ ├── InvalidRootTypeTestCase.cs │ ├── JoinedSubClassTestCase.cs │ ├── JoinedSubClassWithDiscriminatorTestCase.cs │ ├── JoinedTableTestCase.cs │ ├── LazyTestCase.cs │ ├── Model │ │ ├── Animal.cs │ │ ├── AnyModel │ │ │ └── Models.cs │ │ ├── BadPostClass.cs │ │ ├── Blog.cs │ │ ├── BlogLazy.cs │ │ ├── ClassWithBrokenField.cs │ │ ├── Client.cs │ │ ├── Company.cs │ │ ├── CompositeModel │ │ │ ├── Agent.cs │ │ │ ├── AgentKey.cs │ │ │ ├── Group.cs │ │ │ └── Org.cs │ │ ├── CompositeNested │ │ │ └── CompositeNestedParent.cs │ │ ├── CompositeUserType │ │ │ ├── BadProduct.cs │ │ │ ├── DoubleStringType.cs │ │ │ ├── Product.cs │ │ │ └── ProductPropertyAccess.cs │ │ ├── Employee.cs │ │ ├── Entity.cs │ │ ├── EnumModel.cs │ │ ├── Firm.cs │ │ ├── GenericModel │ │ │ ├── AbstractClass.cs │ │ │ ├── Blog.cs │ │ │ ├── Company.cs │ │ │ ├── Employee.cs │ │ │ ├── Entity.cs │ │ │ ├── NullableModel.Generics.cs │ │ │ ├── Person.cs │ │ │ ├── Post.cs │ │ │ └── SurveyAssociation.cs │ │ ├── Hand.cs │ │ ├── IntlName.cs │ │ ├── LazyModel │ │ │ └── ProductLazy.cs │ │ ├── LazyObjectWithLazyBlobProperty.cs │ │ ├── LineItem.cs │ │ ├── Linq │ │ │ ├── Blog.cs │ │ │ ├── Post.cs │ │ │ └── Widget.cs │ │ ├── MultipleDBWithMediator │ │ │ ├── Author.cs │ │ │ ├── Blog.cs │ │ │ └── UserDB.cs │ │ ├── Nested │ │ │ ├── NestedParent.cs │ │ │ ├── Operation.cs │ │ │ └── WithPrefix.cs │ │ ├── NestedValidation │ │ │ └── UserWithNestedAddress.cs │ │ ├── ObjectWithLazyAssociation.cs │ │ ├── Octopus.cs │ │ ├── Order.cs │ │ ├── OtherDbBlog.cs │ │ ├── OtherDbPost.cs │ │ ├── Person.cs │ │ ├── Post.cs │ │ ├── PostLazy.cs │ │ ├── Product.cs │ │ ├── ProductWithGuid.cs │ │ ├── RulesModel │ │ │ └── Rules.cs │ │ ├── SSAFEntity.cs │ │ ├── ScopelessLazy.cs │ │ ├── Ship.cs │ │ ├── SimpleBlog.cs │ │ ├── SimpleModel.cs │ │ ├── SimpleModel2.cs │ │ ├── SimpleModel3.cs │ │ ├── SimplePost.cs │ │ ├── Snippet.cs │ │ ├── StrictModel │ │ │ ├── Estrato.cs │ │ │ ├── QuestionContainer.cs │ │ │ ├── ReferenceEstrato.cs │ │ │ ├── Repository.cs │ │ │ ├── Survey.cs │ │ │ └── SurveyEstrato.cs │ │ ├── Test2ARBase.cs │ │ ├── TimeStamped.cs │ │ ├── VeryLazyObject.cs │ │ └── VeryLazyObject2.cs │ ├── MultipleDBMediatorTest.cs │ ├── MultipleDatabasesTestCase.cs │ ├── NHSearchTestCase.cs │ ├── NUnitInMemoryTest.cs │ ├── NestedClassWithMapTypeTestCase.cs │ ├── NestedClassWithPrefixTestCase.cs │ ├── NestedClassWithRelationsTestCase.cs │ ├── NestedModelValidation.cs │ ├── NullablesGenericsTestCase.cs │ ├── PluralizationTestCase.cs │ ├── PropertyAccessTests │ │ ├── Project.cs │ │ ├── Task.cs │ │ └── TestCases.cs │ ├── ScalarQueryTestCase.cs │ ├── ScopeDefaultFlushingBehaviourTestCase.cs │ ├── SessionScopeAutoflushTestCase.cs │ ├── SessionScopeTestCase.cs │ ├── SimpleQueryWithParameterTypesTestCase.cs │ ├── StatelessSessionScopeTestCase.cs │ ├── StrictModelTestCase.cs │ ├── TableHierarchyTestCase.cs │ ├── Testing │ │ ├── CustomizationTest.cs │ │ └── InitializationTest.cs │ ├── TransactionScopeTestCase.cs │ ├── Validation │ │ ├── ARValidatorTestCase.cs │ │ ├── GenericModel │ │ │ ├── Blog.cs │ │ │ ├── Customer.cs │ │ │ ├── Person.cs │ │ │ ├── TimeSlotFixedDate.cs │ │ │ └── User.cs │ │ ├── Model │ │ │ ├── Blog.cs │ │ │ ├── Customer.cs │ │ │ ├── Person.cs │ │ │ └── User.cs │ │ ├── ValidationTestCase.Generic.cs │ │ └── ValidationTestCase.cs │ └── VerifyModelsAgainstDBSchemaTestCase.cs ├── Castle.ActiveRecord.Web │ ├── Castle.ActiveRecord.Web.csproj │ └── Framework │ │ ├── Scopes │ │ ├── HybridWebThreadScopeInfo.cs │ │ └── WebThreadScopeInfo.cs │ │ └── SessionScopeWebModule.cs └── Castle.ActiveRecord │ ├── Attributes │ ├── ActiveRecordAttribute.cs │ ├── ActiveRecordSkip.cs │ ├── AddEventListenerAttribute.cs │ ├── AnyAttribute.cs │ ├── BaseAttribute.cs │ ├── BelongsToAttribute.cs │ ├── CollectionIDAttribute.cs │ ├── CompositeKeyAttribute.cs │ ├── CompositeUserTypeAttribute.cs │ ├── Enums.cs │ ├── EventListenerAssemblyAttribute.cs │ ├── EventListenerAttribute.cs │ ├── FieldAttribute.cs │ ├── HasAndBelongsToManyAttribute.cs │ ├── HasManyAttribute.cs │ ├── HasManyToAnyAttribute.cs │ ├── HiLoAttribute.cs │ ├── HqlNamedQueryAttribute.cs │ ├── IgnoreEventListenerAttribute.cs │ ├── ImportAttribute.cs │ ├── JoinedBaseAttribute.cs │ ├── JoinedKeyAttribute.cs │ ├── JoinedTableAttribute.cs │ ├── KeyPropertyAttribute.cs │ ├── NestedAttribute.cs │ ├── NestedParentReferenceAttribute.cs │ ├── OneToOneAttribute.cs │ ├── PrimaryKeyAttribute.cs │ ├── PropertyAccess.cs │ ├── PropertyAttribute.cs │ ├── RawXmlMappingAttribute.cs │ ├── RelationAttribute.cs │ ├── SqlNamedQueryAttribute.cs │ ├── TimestampAttribute.cs │ ├── Validations │ │ └── ValidateIsUniqueAttribute.cs │ ├── VersionAttribute.cs │ ├── WithAccessAttribute.cs │ └── WithAccessOptionalTableAttribute.cs │ ├── ByteCode │ ├── LazyInitializer.cs │ ├── ProxyFactory.cs │ └── ProxyFactoryFactory.cs │ ├── Castle.ActiveRecord-vs2010.csproj │ ├── Diagrams │ └── Queries.cd │ ├── Framework │ ├── ARSchemaCreator.cs │ ├── AbstractNHContributor.cs │ ├── ActiveRecordBase.Generic.cs │ ├── ActiveRecordBase.cs │ ├── ActiveRecordException.cs │ ├── ActiveRecordHooksBase.cs │ ├── ActiveRecordHooksValidationBase.cs │ ├── ActiveRecordLinq.cs │ ├── ActiveRecordLinqBase.cs │ ├── ActiveRecordMediator.Generic.cs │ ├── ActiveRecordMediator.cs │ ├── ActiveRecordStarter.cs │ ├── ActiveRecordValidationBase.Generic.cs │ ├── ActiveRecordValidationBase.cs │ ├── ActiveRecordValidationException.cs │ ├── ActiveRecordValidator.cs │ ├── Config │ │ ├── ActiveRecordSectionHandler.cs │ │ ├── Configure.cs │ │ ├── DatabaseType.cs │ │ ├── DefaultActiveRecordConfiguration.cs │ │ ├── DefaultDatabaseConfiguration.cs │ │ ├── DefaultFlushType.cs │ │ ├── DefaultStorageConfiguration.cs │ │ ├── FluentActiveRecordConfiguration.cs │ │ ├── FluentNHibernateMapping.cs │ │ ├── FluentStorageConfiguration.cs │ │ ├── FluentStorageTypeSelection.cs │ │ ├── IActiveRecordConfiguration.cs │ │ ├── IConfigurationSource.cs │ │ ├── IDatabaseConfiguration.cs │ │ ├── IMappingSpecification.cs │ │ ├── IStorageConfiguration.cs │ │ ├── InPlaceConfigurationSource.cs │ │ ├── MsSqlServer2000Configuration.cs │ │ ├── MsSqlServer2005Configuration.cs │ │ ├── StorageTypeSelection.cs │ │ ├── XmlConfigurationSource.cs │ │ └── XmlNhibernateMapping.cs │ ├── CriteriaHelper.cs │ ├── DictionaryAdapter.cs │ ├── HookDispatcher.cs │ ├── INHContributor.cs │ ├── ISessionFactoryHolder.cs │ ├── IThreadScopeInfo.cs │ ├── IValidationProvider.cs │ ├── IWebThreadScopeInfo.cs │ ├── InterceptorFactory.cs │ ├── Internal │ │ ├── ActiveRecordModelBuilder.cs │ │ ├── ActiveRecordModelCollection.cs │ │ ├── AssemblyXmlGenerator.cs │ │ ├── Constants.cs │ │ ├── EventListener │ │ │ ├── EventListenerConfig.cs │ │ │ └── EventListenerContributor.cs │ │ ├── IModelBuilderExtension.cs │ │ ├── IVisitable.cs │ │ ├── IVisitor.cs │ │ ├── Inflector.cs │ │ ├── Model │ │ │ ├── ActiveRecordModel.cs │ │ │ ├── AnyModel.cs │ │ │ ├── BelongsToModel.cs │ │ │ ├── CollectionIDModel.cs │ │ │ ├── CompositeKeyModel.cs │ │ │ ├── CompositeUserTypeModel.cs │ │ │ ├── DependentObjectModel.cs │ │ │ ├── FieldModel.cs │ │ │ ├── HasAndBelongsToManyModel.cs │ │ │ ├── HasManyModel.cs │ │ │ ├── HasManyToAnyModel.cs │ │ │ ├── HiloModel.cs │ │ │ ├── ImportModel.cs │ │ │ ├── JoinedTableModel.cs │ │ │ ├── KeyModel.cs │ │ │ ├── NestedModel.cs │ │ │ ├── NestedParentReferenceModel.cs │ │ │ ├── OneToOneModel.cs │ │ │ ├── PrimaryKeyModel.cs │ │ │ ├── PropertyModel.cs │ │ │ ├── TimestampModel.cs │ │ │ └── VersionModel.cs │ │ ├── ModelBuilderExtensionComposite.cs │ │ ├── NHibernateNullablesSupport.cs │ │ └── Visitors │ │ │ ├── AbstractDepthFirstVisitor.cs │ │ │ ├── GraphConnectorVisitor.cs │ │ │ ├── SemanticVerifierVisitor.cs │ │ │ └── XmlGenerationVisitor.cs │ ├── NHEventListeners.cs │ ├── NHSearchContributor.cs │ ├── NotFoundException.cs │ ├── Queries │ │ ├── ActiveRecordBaseQuery.cs │ │ ├── ActiveRecordCriteriaQuery.cs │ │ ├── ActiveRecordMultiQuery.cs │ │ ├── CountQuery.cs │ │ ├── HqlBasedQuery.cs │ │ ├── IActiveRecordQuery.Generic.cs │ │ ├── IActiveRecordQuery.cs │ │ ├── LinqQuery.cs │ │ ├── Modifiers │ │ │ ├── IQueryModifier.cs │ │ │ ├── QueryParameter.cs │ │ │ ├── QueryRange.cs │ │ │ ├── QueryResultTransformer.cs │ │ │ ├── SqlQueryJoinDefinition.cs │ │ │ ├── SqlQueryReturnDefinition.cs │ │ │ └── SqlQueryScalarDefinition.cs │ │ ├── ProjectionQuery.cs │ │ ├── ScalarProjectionQuery.cs │ │ ├── ScalarQuery.Generic.cs │ │ ├── ScalarQuery.cs │ │ ├── SimpleQuery.Generic.cs │ │ ├── SimpleQuery.cs │ │ └── ValueAndTypeTuple.cs │ ├── Scopes │ │ ├── AbstractScope.cs │ │ ├── AbstractThreadScopeInfo.cs │ │ ├── ConversationCanceledEventArgs.cs │ │ ├── ConversationalScope.cs │ │ ├── DifferentDatabaseScope.cs │ │ ├── FlushAction.cs │ │ ├── IConversation.cs │ │ ├── IScopeConversation.cs │ │ ├── ISessionScope.cs │ │ ├── ScopeMachineryException.cs │ │ ├── ScopeUtil.cs │ │ ├── ScopedConversation.cs │ │ ├── SessionScope.cs │ │ ├── StatelessSessionScope.cs │ │ ├── ThreadScopeAccessor.cs │ │ ├── ThreadScopeInfo.cs │ │ └── TransactionScope.cs │ ├── SessionFactoryHolder.cs │ ├── StatelessSessionWrapper.cs │ ├── SupportingUtils.cs │ ├── TransactionException.cs │ └── Validators │ │ └── IsUniqueValidator.cs │ ├── PrivateAssemblyInfo.cs │ └── Testing │ ├── InMemoryConnectionProvider.cs │ └── InMemoryTest.cs └── tools ├── MSBuildCommunityTasks ├── Ionic.Zip.Reduced.dll ├── MSBuild.Community.Tasks.Targets ├── MSBuild.Community.Tasks.chm └── MSBuild.Community.Tasks.dll └── NUnit ├── bin ├── NUnitFitTests.html ├── NUnitTests.config ├── NUnitTests.nunit ├── agent.conf ├── agent.log.conf ├── framework │ ├── nunit.framework.dll │ ├── nunit.framework.xml │ ├── nunit.mocks.dll │ └── pnunit.framework.dll ├── launcher.log.conf ├── lib │ ├── Failure.png │ ├── Ignored.png │ ├── Inconclusive.png │ ├── Skipped.png │ ├── Success.png │ ├── fit.dll │ ├── log4net.dll │ ├── nunit-console-runner.dll │ ├── nunit-gui-runner.dll │ ├── nunit.core.dll │ ├── nunit.core.interfaces.dll │ ├── nunit.fixtures.dll │ ├── nunit.uiexception.dll │ ├── nunit.uikit.dll │ └── nunit.util.dll ├── nunit-agent-x86.exe ├── nunit-agent-x86.exe.config ├── nunit-agent.exe ├── nunit-agent.exe.config ├── nunit-console-x86.exe ├── nunit-console-x86.exe.config ├── nunit-console.exe ├── nunit-console.exe.config ├── nunit-x86.exe ├── nunit-x86.exe.config ├── nunit.exe ├── nunit.exe.config ├── nunit.framework.dll ├── pnunit-agent.exe ├── pnunit-agent.exe.config ├── pnunit-launcher.exe ├── pnunit-launcher.exe.config ├── pnunit.framework.dll ├── pnunit.tests.dll ├── runFile.exe ├── runFile.exe.config ├── runpnunit.bat ├── test.conf └── tests │ ├── loadtest-assembly.dll │ ├── mock-assembly.dll │ ├── nonamespace-assembly.dll │ ├── nunit-console.tests.dll │ ├── nunit-gui.tests.dll │ ├── nunit.core.tests.dll │ ├── nunit.fixtures.tests.dll │ ├── nunit.framework.dll │ ├── nunit.framework.tests.dll │ ├── nunit.mocks.tests.dll │ ├── nunit.uiexception.tests.dll │ ├── nunit.uikit.tests.dll │ ├── nunit.util.tests.dll │ ├── test-assembly.dll │ ├── test-utilities.dll │ └── timing-tests.dll └── license.txt /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | /build 3 | AssemblyInfo.cs 4 | 5 | # Standard VS.NET and ReSharper Foo 6 | src/*/obj 7 | src/*/bin 8 | *.csproj.user 9 | _ReSharper* 10 | *ReSharper.* 11 | *.suo 12 | *.cache 13 | * Thumbs.db -------------------------------------------------------------------------------- /ClickToBuild.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | REM **************************************************************************** 3 | REM Copyright 2004-2010 Castle Project - http://www.castleproject.org/ 4 | REM Licensed under the Apache License, Version 2.0 (the "License"); 5 | REM you may not use this file except in compliance with the License. 6 | REM You may obtain a copy of the License at 7 | REM 8 | REM http://www.apache.org/licenses/LICENSE-2.0 9 | REM 10 | REM Unless required by applicable law or agreed to in writing, software 11 | REM distributed under the License is distributed on an "AS IS" BASIS, 12 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | REM See the License for the specific language governing permissions and 14 | REM limitations under the License. 15 | REM **************************************************************************** 16 | 17 | ECHO This script builds the project in Release configuration 18 | 19 | SET CLICKTOBUILD=1 20 | CALL buildscripts\build.cmd 21 | SET CLICKTOBUILD= 22 | 23 | IF %ERRORLEVEL% NEQ 0 GOTO err 24 | ECHO ************************************************************** 25 | ECHO The binaries can be found in the following folder: 26 | ECHO %__OUTDIR__% 27 | ECHO ************************************************************** 28 | 29 | :err 30 | PAUSE 31 | @EXIT /B %ERRORLEVEL% 32 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Castle ActiveRecord 2 | 3 | 4 | 5 | The **Castle ActiveRecord** project is an implementation of the [ActiveRecord pattern](http://en.wikipedia.org/wiki/Active_record) for .NET. The ActiveRecord pattern consists on instance properties representing a record in the database, instance methods acting on that specific record and static methods acting on all records. 6 | 7 | See the [documentation](docs/README.md). 8 | 9 | ## Releases 10 | 11 | See the [Releases](http://sourceforge.net/projects/castleproject/files/ActiveRecord/). 12 | 13 | ## Copyright 14 | 15 | Copyright 2004-2015 Castle Project 16 | 17 | ## License 18 | 19 | Castle Core is licensed under the [Apache 2.0](http://opensource.org/licenses/Apache-2.0) license. Refer to license.txt for more information. -------------------------------------------------------------------------------- /Running the test cases.txt: -------------------------------------------------------------------------------- 1 | The test cases run against a MSSQL Server 2000 database by default, but due to 2 | NHibernate's features, you can change the database to whatever you like. 3 | 4 | 5 | 1. Modify the Connection properties information: 6 | 7 | The basic NHibernate settings can be set as NAnt arguments. See the "How to build.txt" 8 | file in the root of the repository for details. 9 | 10 | See file Castle.ActiveRecord.Tests\Castle.ActiveRecord.Tests.dll.config for full config. 11 | 12 | 2. Create the database 13 | 14 | The Test cases will generate all the necessary schema. 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | REM **************************************************************************** 3 | REM Copyright 2004-2010 Castle Project - http://www.castleproject.org/ 4 | REM Licensed under the Apache License, Version 2.0 (the "License"); 5 | REM you may not use this file except in compliance with the License. 6 | REM You may obtain a copy of the License at 7 | REM 8 | REM http://www.apache.org/licenses/LICENSE-2.0 9 | REM 10 | REM Unless required by applicable law or agreed to in writing, software 11 | REM distributed under the License is distributed on an "AS IS" BASIS, 12 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | REM See the License for the specific language governing permissions and 14 | REM limitations under the License. 15 | REM **************************************************************************** 16 | 17 | @call buildscripts\build.cmd %* -------------------------------------------------------------------------------- /buildscripts/CastleKey.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/buildscripts/CastleKey.snk -------------------------------------------------------------------------------- /buildscripts/Committers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/buildscripts/Committers.txt -------------------------------------------------------------------------------- /buildscripts/CommonAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System.Reflection; 16 | 17 | [assembly: AssemblyCompany("Castle Project")] 18 | [assembly: AssemblyCopyright("Copyright (c) 2004-2010 Castle Project - http://www.castleproject.org")] 19 | -------------------------------------------------------------------------------- /docs/accessing-more-than-one-database.md: -------------------------------------------------------------------------------- 1 | # Accessing more than one database 2 | 3 | You can use more than one database with ActiveRecord. In order to do so you must create base classes that define, based on the hierarchy, which database is being used. Those are called *Root types*. If you use just one database, the *root type* is `ActiveRecordBase`. 4 | 5 | ## Adding a different database 6 | 7 | Let's analyze the steps involved in getting ActiveRecord to work with more than one database. 8 | 9 | ### First: Create your root type 10 | 11 | You must create an abstract class. It is recommended that this class extends ActiveRecordBase, because all *ActiveRecord types* bound to the second database must use it as the base class. This class can be empty. 12 | 13 | However, it is not necessary to extend ActiveRecordBase. When ActiveRecord is used without base types (using ActiveRecordMediator), there is no gain from extending ActiveRecordBase, and inheriting from it can be safely omitted. 14 | 15 | ```csharp 16 | using Castle.ActiveRecord 17 | 18 | public abstract class LogisticDatabase : ActiveRecordBase 19 | { 20 | } 21 | ``` 22 | 23 | The class must not create a table by its own. It cannot be used as direct base class for single table or class table inheritance as described under [Implementing Type hierarchies](type-hierarchy.md). 24 | 25 | ### Second: configure the second database 26 | 27 | On the existing configuration, you must use add another config set bound to the abstract class you have just created. For more information on it, see [XML Configuration Reference](xml-configuration-reference.md). -------------------------------------------------------------------------------- /docs/framework-events.md: -------------------------------------------------------------------------------- 1 | # Framework Events 2 | 3 | ActiveRecord exposes some events that you might use to integrate it with a top level framework. 4 | 5 | ## ActiveRecordStarter.SessionFactoryHolderCreated 6 | 7 | You can subscribe to this event to get notification about the creation of an `ISessionFactoryHolder` instance implementation. 8 | 9 | ## ISessionFactoryHolder.OnRootTypeRegistered 10 | 11 | You can subscribe to this event to get notification when a *root type* is registered. A *root type* defines the database being used. If you are using only one database the *root type* will be `ActiveRecordBase`. -------------------------------------------------------------------------------- /docs/hooks-and-lifecycle.md: -------------------------------------------------------------------------------- 1 | # Hooks and Lifecycle 2 | 3 | The `ActiveRecordBase` class implements NHibernate's `ILifecycle` interface. For more information on the methods involve, consult the [NHibernate documentation](http://nhforge.org/doc/nh/en/index.html). 4 | 5 | Additionaly all `ISession` instances are linked to an `IInterceptor` implementation which ultimately invokes your ActiveRecord class instance. This is a fairly advanced usage. -------------------------------------------------------------------------------- /docs/images/castle-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/docs/images/castle-logo.png -------------------------------------------------------------------------------- /docs/markdownlint.rb: -------------------------------------------------------------------------------- 1 | all 2 | exclude_rule 'MD010' # Hard tabs - too much example code has tabs 3 | exclude_rule 'MD013' # Line length 4 | exclude_rule 'MD026' # Trailing punctuation in header 5 | exclude_rule 'MD033' # Inline HTML - for right-aligning an image 6 | exclude_rule 'MD040' # Fenced code blocks should have a language specified -------------------------------------------------------------------------------- /docs/using-imports.md: -------------------------------------------------------------------------------- 1 | # Using Imports 2 | 3 | If there is a collision of names among your entities, you may use `Import` so you do not need to use their full name on queries. 4 | 5 | You can also use imports to query returns to classes. 6 | 7 | ```csharp 8 | using Castle.Framework; 9 | 10 | [ActiveRecord, Import(typeof(OrderSummary), "summary")] 11 | public class Order : ActiveRecordBase 12 | { 13 | // omitted for clarity 14 | } 15 | 16 | public class OrderSummary 17 | { 18 | private float value; 19 | private int quantity; 20 | 21 | public float Value 22 | { 23 | get { return value; } 24 | set { this.value = value; } 25 | } 26 | 27 | public int Quantity 28 | { 29 | get { return quantity; } 30 | set { quantity = value; } 31 | } 32 | } 33 | ``` -------------------------------------------------------------------------------- /docs/using-version-and-timestamp.md: -------------------------------------------------------------------------------- 1 | # Using Version and Timestamp 2 | 3 | NHibernate's Version and Timestamp feature can be used on Castle ActiveRecord as well. Those are used to detect changes from other processes/requests, avoiding a last-win situation. 4 | 5 | When saving, NHibernate will make sure that the update will only succeed if the version/timestamp in the database match the version/timestamp on the object. If they are different, the changes will not be saved, and a `StaleObjectException` will be thrown. 6 | 7 | ## Using Version 8 | 9 | Version can be of the following types: `Int64`, `Int32`, `Int16`, `Ticks`, `Timestamp`, or `TimeSpan`. 10 | 11 | ```csharp 12 | [Version("customer_version")] 13 | public Int32 Version 14 | { 15 | get { return version; } 16 | set { version = value; } 17 | } 18 | ``` 19 | 20 | ## Using Timestamp 21 | 22 | Note that using the `Timestamp` attribute is equal to using the `Version` attribute with `Type="timestamp"`. Because of timestamp precision issues, `Version` is consider safer to use than `Timestamp` 23 | 24 | ```csharp 25 | [Timestamp("customer_timestamp")] 26 | public Int32 Timestamp 27 | { 28 | get { return ts; } 29 | set { ts = value; } 30 | } 31 | ``` -------------------------------------------------------------------------------- /lib/Iesi.Collections.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/Iesi.Collections.dll -------------------------------------------------------------------------------- /lib/Iesi.Collections.license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/Iesi.Collections.license.txt -------------------------------------------------------------------------------- /lib/Iesi.Collections.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/Iesi.Collections.pdb -------------------------------------------------------------------------------- /lib/Lucene.Net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/Lucene.Net.dll -------------------------------------------------------------------------------- /lib/Lucene.Net.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/Lucene.Net.pdb -------------------------------------------------------------------------------- /lib/NHibernate.ByteCode.Castle.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/NHibernate.ByteCode.Castle.dll -------------------------------------------------------------------------------- /lib/NHibernate.ByteCode.Castle.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/NHibernate.ByteCode.Castle.pdb -------------------------------------------------------------------------------- /lib/NHibernate.Search.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/NHibernate.Search.dll -------------------------------------------------------------------------------- /lib/NHibernate.Search.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/NHibernate.Search.pdb -------------------------------------------------------------------------------- /lib/NHibernate.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/NHibernate.dll -------------------------------------------------------------------------------- /lib/NHibernate.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/NHibernate.pdb -------------------------------------------------------------------------------- /lib/mono-3.5/Castle.Components.Validator.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/mono-3.5/Castle.Components.Validator.dll -------------------------------------------------------------------------------- /lib/mono-3.5/Castle.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/mono-3.5/Castle.Core.dll -------------------------------------------------------------------------------- /lib/mono-3.5/Castle.DynamicProxy2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/mono-3.5/Castle.DynamicProxy2.dll -------------------------------------------------------------------------------- /lib/mono-3.5/MySql.Data.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/mono-3.5/MySql.Data.dll -------------------------------------------------------------------------------- /lib/mono-3.5/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/mono-3.5/log4net.dll -------------------------------------------------------------------------------- /lib/net35/Castle.Components.Validator.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net35/Castle.Components.Validator.dll -------------------------------------------------------------------------------- /lib/net35/Castle.Components.Validator.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net35/Castle.Components.Validator.pdb -------------------------------------------------------------------------------- /lib/net35/Castle.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net35/Castle.Core.dll -------------------------------------------------------------------------------- /lib/net35/Castle.Core.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net35/Castle.Core.pdb -------------------------------------------------------------------------------- /lib/net35/System.Data.SQLite.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net35/System.Data.SQLite.DLL -------------------------------------------------------------------------------- /lib/net35/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net35/log4net.dll -------------------------------------------------------------------------------- /lib/net35/x64/System.Data.SQLite.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net35/x64/System.Data.SQLite.dll -------------------------------------------------------------------------------- /lib/net40/Castle.Components.Validator.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net40/Castle.Components.Validator.dll -------------------------------------------------------------------------------- /lib/net40/Castle.Components.Validator.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net40/Castle.Components.Validator.pdb -------------------------------------------------------------------------------- /lib/net40/Castle.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net40/Castle.Core.dll -------------------------------------------------------------------------------- /lib/net40/Castle.Core.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net40/Castle.Core.pdb -------------------------------------------------------------------------------- /lib/net40/System.Data.SQLite.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net40/System.Data.SQLite.DLL -------------------------------------------------------------------------------- /lib/net40/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net40/log4net.dll -------------------------------------------------------------------------------- /lib/net40/x64/System.Data.SQLite.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/net40/x64/System.Data.SQLite.dll -------------------------------------------------------------------------------- /lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/nunit.framework.dll -------------------------------------------------------------------------------- /lib/nunit.framework.license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/lib/nunit.framework.license.txt -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/AbstractActiveRecordTest.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests 16 | { 17 | using NUnit.Framework; 18 | 19 | public abstract class AbstractActiveRecordTest 20 | { 21 | [SetUp] 22 | public void Init() 23 | { 24 | ActiveRecordStarter.ResetInitializationFlag(); 25 | } 26 | 27 | protected IConfigurationSource GetConfigSource() 28 | { 29 | return System.Configuration.ConfigurationManager.GetSection("activerecord") as IConfigurationSource; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/BadCompositeKey.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | public class BadCompositeKey 18 | { 19 | private string keyA; 20 | private string keyB; 21 | 22 | [KeyProperty] 23 | public virtual string KeyA 24 | { 25 | get { return keyA; } 26 | set { keyA = value; } 27 | } 28 | 29 | [KeyProperty] 30 | public virtual string KeyB 31 | { 32 | get { return keyB; } 33 | set { keyB = value; } 34 | } 35 | 36 | public override int GetHashCode() 37 | { 38 | return base.GetHashCode(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/BelongsToWithFetch.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 6 | { 7 | class BelongsToWithFetch 8 | { 9 | } 10 | } 11 | 12 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 13 | // 14 | // Licensed under the Apache License, Version 2.0 (the "License"); 15 | // you may not use this file except in compliance with the License. 16 | // You may obtain a copy of the License at 17 | // 18 | // http://www.apache.org/licenses/LICENSE-2.0 19 | // 20 | // Unless required by applicable law or agreed to in writing, software 21 | // distributed under the License is distributed on an "AS IS" BASIS, 22 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | // See the License for the specific language governing permissions and 24 | // limitations under the License. 25 | 26 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 27 | { 28 | using System; 29 | 30 | [ActiveRecord(Lazy = false)] 31 | public class BelongsToClassAFetch : ActiveRecordBase 32 | { 33 | private int id; 34 | private ClassA classA; 35 | 36 | [PrimaryKey] 37 | public int Id 38 | { 39 | get { return id; } 40 | set { id = value; } 41 | } 42 | 43 | [BelongsTo("classa_id", Fetch=FetchEnum.Join)] 44 | public ClassA ClassA 45 | { 46 | get { return classA; } 47 | set { classA = value; } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/BelongsToWithLazy.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | [ActiveRecord(Lazy = false)] 18 | public class BelongsToWithLazy : ActiveRecordBase 19 | { 20 | private int id; 21 | private ClassA classA; 22 | private ClassA classA2; 23 | 24 | [PrimaryKey] 25 | public int Id 26 | { 27 | get { return id; } 28 | set { id = value; } 29 | } 30 | 31 | [BelongsTo("classa_id", Lazy = FetchWhen.Immediate)] 32 | public ClassA ClassA 33 | { 34 | get { return classA; } 35 | set { classA = value; } 36 | } 37 | 38 | [BelongsTo("classa2_id")] 39 | public ClassA ClassA2 40 | { 41 | get { return classA2; } 42 | set { classA2 = value; } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/Category.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | [ActiveRecord(Lazy = false)] 21 | public class Category : ActiveRecordBase 22 | { 23 | private int id; 24 | private string name; 25 | private Category parent; 26 | private IList subcategories; 27 | 28 | [PrimaryKey] 29 | public int Id 30 | { 31 | get { return id; } 32 | set { id = value; } 33 | } 34 | 35 | [Property] 36 | public string Name 37 | { 38 | get { return name; } 39 | set { name = value; } 40 | } 41 | 42 | [BelongsTo("parent_id")] 43 | public Category Parent 44 | { 45 | get { return parent; } 46 | set { parent = value; } 47 | } 48 | 49 | [HasMany( typeof(Category) )] 50 | public IList SubCategories 51 | { 52 | get { return subcategories; } 53 | set { subcategories = value; } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassDiscriminatorLengthParent.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord("disctable", DiscriminatorColumn="type", DiscriminatorType="String", DiscriminatorValue="parent", DiscriminatorLength="10")] 20 | public class ClassDiscriminatorLengthParent : ActiveRecordBase 21 | { 22 | private int id; 23 | private string name; 24 | 25 | [PrimaryKey] 26 | public int Id 27 | { 28 | get { return id; } 29 | set { id = value; } 30 | } 31 | 32 | [Property] 33 | public string Name 34 | { 35 | get { return name; } 36 | set { name = value; } 37 | } 38 | } 39 | 40 | [ActiveRecord(DiscriminatorValue="B")] 41 | public class ClassDiscriminatorB : ClassDiscriminatorLengthParent 42 | { 43 | private int age; 44 | 45 | [Property] 46 | public int Age 47 | { 48 | get { return age; } 49 | set { age = value; } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassDiscriminatorParent.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord("disctable", DiscriminatorColumn="type", DiscriminatorType="String", DiscriminatorValue="parent")] 20 | public class ClassDiscriminatorParent : ActiveRecordBase 21 | { 22 | private int id; 23 | private string name; 24 | 25 | [PrimaryKey] 26 | public int Id 27 | { 28 | get { return id; } 29 | set { id = value; } 30 | } 31 | 32 | [Property] 33 | public string Name 34 | { 35 | get { return name; } 36 | set { name = value; } 37 | } 38 | } 39 | 40 | [ActiveRecord(DiscriminatorValue="A")] 41 | public class ClassDiscriminatorA : ClassDiscriminatorParent 42 | { 43 | private int age; 44 | 45 | [Property] 46 | public int Age 47 | { 48 | get { return age; } 49 | set { age = value; } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassJoinedSubClassParent.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | [ActiveRecord("disctable", Lazy = false), JoinedBase] 18 | public class ClassJoinedSubClassParent : ActiveRecordBase 19 | { 20 | private int id; 21 | private string name; 22 | 23 | [PrimaryKey] 24 | public int Id 25 | { 26 | get { return id; } 27 | set { id = value; } 28 | } 29 | 30 | [Property] 31 | public string Name 32 | { 33 | get { return name; } 34 | set { name = value; } 35 | } 36 | } 37 | 38 | [ActiveRecord("disctablea", Lazy = false)] 39 | public class ClassJoinedSubClassA : ClassJoinedSubClassParent 40 | { 41 | private int aid; 42 | private int age; 43 | 44 | [JoinedKey] 45 | public int AId 46 | { 47 | get { return aid; } 48 | set { aid = value; } 49 | } 50 | 51 | [Property] 52 | public int Age 53 | { 54 | get { return age; } 55 | set { age = value; } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassKeyAssigned.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord] 20 | public class ClassKeyAssigned : ActiveRecordBase 21 | { 22 | private int id; 23 | private String name1; 24 | private DateTime insertion; 25 | 26 | [PrimaryKey(PrimaryKeyType.Assigned)] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [Property] 34 | public string Name1 35 | { 36 | get { return name1; } 37 | set { name1 = value; } 38 | } 39 | 40 | [Property(Default="getdate()")] 41 | public DateTime Insertion 42 | { 43 | get { return insertion; } 44 | set { insertion = value; } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithBadCompositeKey.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | [ActiveRecord] 18 | public class ClassWithBadCompositeKey 19 | { 20 | private BadCompositeKey _key; 21 | 22 | [CompositeKey] 23 | public BadCompositeKey Key 24 | { 25 | get { return _key; } 26 | set { _key = value; } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithBadMapping.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | using System.Text; 19 | 20 | /// 21 | /// Used to verify that you can't map an AR class as a [Property] 22 | /// 23 | [ActiveRecord] 24 | public class ClassWithBadMapping 25 | { 26 | [PrimaryKey(PrimaryKeyType.Identity)] 27 | public int Id 28 | { 29 | get { return 9; } 30 | set { } 31 | } 32 | [Property] 33 | public ClassA ClassA 34 | { 35 | get { return null; } 36 | set { } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithCompositeKey.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | [ActiveRecord(Lazy = false)] 18 | public class ClassWithCompositeKey 19 | { 20 | private CompositeKeyForClassWithCompositeKey _key; 21 | 22 | [CompositeKey] 23 | public CompositeKeyForClassWithCompositeKey Key 24 | { 25 | get { return _key; } 26 | set { _key = value; } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithElementList.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System.Collections; 18 | 19 | [ActiveRecord] 20 | public class ClassWithElementList 21 | { 22 | int id; 23 | IList elements; 24 | 25 | [PrimaryKey] 26 | public int Id 27 | { 28 | get { return id; } 29 | set { id = value; } 30 | } 31 | 32 | [HasMany(typeof(string), "ClassId", "Elements", Element = "Name")] 33 | public IList Elements 34 | { 35 | get { return elements; } 36 | set { elements = value; } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithExtraLazyOnHasMany.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System.Collections.Generic; 18 | 19 | [ActiveRecord] 20 | public class ClassWithExtraLazyOnHasMany : ActiveRecordBase 21 | { 22 | [PrimaryKey] 23 | public int Id { get; set; } 24 | 25 | [BelongsTo("Parent_Id")] 26 | public ClassWithExtraLazyOnHasMany Parent { get; set; } 27 | 28 | [HasMany(Lazy = true, ExtraLazy = true)] 29 | public IList Children { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithIndexOnHasMany.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System.Collections.Generic; 18 | 19 | [ActiveRecord] 20 | public class ClassWithIndexOnHasMany : ActiveRecordBase 21 | { 22 | [PrimaryKey] 23 | public int Id { get; set; } 24 | 25 | [BelongsTo("Parent_Id",Index = "parent_child_index")] 26 | public ClassWithIndexOnHasMany Parent { get; set; } 27 | 28 | [HasMany] 29 | public IList Children { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithLazyBlobProperty.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord] 20 | public class ClassWithLazyBlobProperty : ActiveRecordBase 21 | { 22 | [PrimaryKey] 23 | public virtual int Id { get; set; } 24 | 25 | [Property(Lazy = true, ColumnType = "BinaryBlob")] 26 | public virtual byte[] BlobData { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithMappedField.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord] 20 | public class ClassWithMappedField 21 | { 22 | private int _id; 23 | 24 | [Field("MyCustomName")] 25 | private String name1 = ""; 26 | 27 | [PrimaryKey(Access=PropertyAccess.NosetterCamelcaseUnderscore)] 28 | public int Id 29 | { 30 | get { return _id; } 31 | } 32 | 33 | [Property(CustomAccess="CustomAccess")] 34 | public int Value 35 | { 36 | get { return _id;} 37 | set { _id = value;} 38 | } 39 | 40 | public string Name1 41 | { 42 | get { return name1; } 43 | set { name1 = value; } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithMultiplePrimaryKeys.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | [ActiveRecord] 18 | public class ClassWithMultiplePrimaryKeys : ActiveRecordBase 19 | { 20 | private int id1; 21 | private int id2; 22 | 23 | [PrimaryKey] 24 | public int Id1 25 | { 26 | get { return id1; } 27 | set { id1 = value; } 28 | } 29 | 30 | [PrimaryKey] 31 | public int Id2 32 | { 33 | get { return id2; } 34 | set { id2 = value; } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithSchemaAction.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | using Castle.ActiveRecord; 20 | 21 | [ActiveRecord(SchemaAction="none")] 22 | public class ClassWithSchemaAction : ActiveRecordBase 23 | { 24 | [PrimaryKey] 25 | public int Id { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithSomeCustomOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord("ClassA", SelectBeforeUpdate=true, Locking=OptimisticLocking.Dirty, Polymorphism=Polymorphism.Explicit, BatchSize=10)] 20 | public class ClassWithSomeCustomOptions : ActiveRecordBase 21 | { 22 | private int id; 23 | private String name1; 24 | 25 | [PrimaryKey] 26 | public int Id 27 | { 28 | get { return id; } 29 | set { id = value; } 30 | } 31 | 32 | [Property(Insert=false, Update=false)] 33 | public string Name1 34 | { 35 | get { return name1; } 36 | set { name1 = value; } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithTuplizer.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | [ActiveRecord(Tuplizer = typeof(Tuplizer))] 18 | public class ClassWithTuplizer : ActiveRecordBase 19 | { 20 | private int id; 21 | 22 | [PrimaryKey] 23 | public int Id 24 | { 25 | get { return id; } 26 | set { id = value; } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ClassWithoutPrimaryKey.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | [ActiveRecord] 18 | public class ClassWithoutPrimaryKey : ActiveRecordBase 19 | { 20 | int _id; 21 | 22 | [Property] 23 | public int Id 24 | { 25 | get { return _id; } 26 | set { _id = value; } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/Company.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | /// 18 | /// Warning: This is a wrong definition! 19 | /// 20 | [ActiveRecord(DiscriminatorColumn="column", DiscriminatorValue="1"), JoinedBase] 21 | public class Company : ActiveRecordBase 22 | { 23 | public Company() 24 | { 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/Component.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | internal class Component 18 | { 19 | private string value; 20 | 21 | [Property] 22 | public string Value 23 | { 24 | get { return value; } 25 | set { this.value = value; } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ComponentManyToClassA.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests 16 | { 17 | using Castle.ActiveRecord.Framework.Internal.Tests.Model; 18 | 19 | public class ComponentManyToClassA 20 | { 21 | private string value; 22 | private ClassA a; 23 | 24 | public ComponentManyToClassA() 25 | { 26 | } 27 | 28 | [Property] 29 | public string Value 30 | { 31 | get { return value; } 32 | set { this.value = value; } 33 | } 34 | 35 | [BelongsTo("aId")] 36 | public ClassA A 37 | { 38 | get { return a; } 39 | set { a = value; } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ComponentWithNested.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | internal class ComponentWithNested2LevelsDeep 18 | { 19 | private ComponentWithNested value; 20 | 21 | [Nested] 22 | public ComponentWithNested ComponentWithNested 23 | { 24 | get { return value; } 25 | set { this.value = value; } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ComponentWithNested2LevelsDeep.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | internal class ComponentWithNested 18 | { 19 | private Component value; 20 | 21 | [Nested] 22 | public Component Component 23 | { 24 | get { return value; } 25 | set { this.value = value; } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/DictionaryModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | using System.Collections.Generic; 19 | 20 | [ActiveRecord] 21 | public class DictionaryModel 22 | { 23 | private int id; 24 | private IDictionary snippet = new Dictionary(); 25 | 26 | [PrimaryKey] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [HasMany(ColumnKey = "id", Index = "LangCode", Element = "Text")] 34 | public IDictionary Snippet 35 | { 36 | get { return snippet; } 37 | set { snippet = value; } 38 | } 39 | } 40 | } 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/DiscriminatorGrandchild.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | [ActiveRecord(DiscriminatorValue="b")] 18 | class DiscriminatorGrandchild : ClassDiscriminatorA 19 | { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/EnumModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System.Collections.Generic; 18 | 19 | public enum Role 20 | { 21 | User, 22 | Admin 23 | } 24 | 25 | [ActiveRecord] 26 | public class EnumModel 27 | { 28 | private int _id; 29 | private IList _roles = new List(); 30 | 31 | [PrimaryKey] 32 | public int Id { 33 | get { return _id; } 34 | set { _id = value; } 35 | } 36 | 37 | /// 38 | /// The element mapping is guessed from the enum type. 39 | /// for mapping details. 40 | /// 41 | [HasMany(Table = "Roles")] 42 | public IList Roles { 43 | get { return _roles; } 44 | set { _roles = value; } 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/HasAndBelongsToClassA.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | using System.Collections.Generic; 19 | 20 | [ActiveRecord(Lazy = false)] 21 | public class HasAndBelongsToClassA : ActiveRecordBase 22 | { 23 | private int id; 24 | private IList classA; 25 | 26 | [PrimaryKey] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [HasAndBelongsToMany(Table = "ClassARelationTable", 34 | ColumnKey = "keycol", 35 | ColumnRef = "Other", 36 | Inverse = true, 37 | ForeignKey = "FK_FOREIGN_KEY_A")] 38 | public IList ClassA 39 | { 40 | get { return classA; } 41 | set { classA = value; } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/HasAndBelongsToManyWithBadList.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | [ActiveRecord(Lazy = false)] 21 | public class HasAndBelongsToManyWithBadList : ActiveRecordBase 22 | { 23 | private int id; 24 | private IList list; 25 | 26 | [PrimaryKey] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [HasAndBelongsToMany(typeof(ClassA), ColumnKey="keycol", Table="ClassARelationTable", ColumnRef="Other", Inverse = true, RelationType= RelationType.List)] 34 | public IList Items 35 | { 36 | get { return list; } 37 | set { list = value; } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/HasManyClassA.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | [ActiveRecord(Lazy = false)] 21 | public class HasManyClassA : ActiveRecordBase 22 | { 23 | private int id; 24 | private IList list; 25 | 26 | [PrimaryKey] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [HasMany( typeof(ClassA), "keycol", "ClassATable", Inverse=true )] 34 | public IList Items 35 | { 36 | get { return list; } 37 | set { list = value; } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/HasManyDependentObjects.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System.Collections; 18 | 19 | [ActiveRecord] 20 | internal class HasManyDependentObjects : ActiveRecordBase 21 | { 22 | private int id; 23 | private IList components = new ArrayList(); 24 | 25 | [PrimaryKey] 26 | public int Id 27 | { 28 | get { return id; } 29 | set { id = value; } 30 | } 31 | 32 | [HasMany(typeof(Component), "id", 33 | "dependent_objects", Index = "pos", 34 | RelationType=RelationType.List, DependentObjects = true)] 35 | public IList Components 36 | { 37 | get { return components; } 38 | set { components = value; } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/HasManyDependentObjectsWithNested.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System.Collections; 18 | 19 | [ActiveRecord] 20 | internal class HasManyDependentObjectsWithNested : ActiveRecordBase 21 | { 22 | private int id; 23 | private IList componentsWithNested = new ArrayList(); 24 | 25 | [PrimaryKey] 26 | public int Id 27 | { 28 | get { return id; } 29 | set { id = value; } 30 | } 31 | 32 | [HasMany(typeof(ComponentWithNested), "id", 33 | "dependent_objects", Index = "pos", 34 | RelationType=RelationType.List, DependentObjects = true)] 35 | public IList ComponentsWithNested 36 | { 37 | get { return componentsWithNested; } 38 | set { componentsWithNested = value; } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/HasManyDependentObjectsWithNested2LevelsDeep.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System.Collections; 18 | 19 | [ActiveRecord] 20 | internal class HasManyDependentObjectsWithNested2LevelsDeep : ActiveRecordBase 21 | { 22 | private int id; 23 | private IList componentsWithNested2LevelsDeep = new ArrayList(); 24 | 25 | [PrimaryKey] 26 | public int Id 27 | { 28 | get { return id; } 29 | set { id = value; } 30 | } 31 | 32 | [HasMany(typeof(ComponentWithNested2LevelsDeep), "id", 33 | "dependent_objects", Index = "pos", 34 | RelationType=RelationType.List, DependentObjects = true)] 35 | public IList ComponentsWithNested2LevelsDeep 36 | { 37 | get { return componentsWithNested2LevelsDeep; } 38 | set { componentsWithNested2LevelsDeep = value; } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/HasManyToAnyWithBadList.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | [ActiveRecord(Lazy = false)] 21 | public class HasManyToAnyWithBadList : ActiveRecordBase 22 | { 23 | private int id; 24 | private IList list; 25 | 26 | [PrimaryKey] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [HasManyToAny(typeof(ClassA), "keycol", "ClassATable", typeof(string), "foo", "bar", Inverse = true, RelationType = RelationType.List)] 34 | public IList Items 35 | { 36 | get { return list; } 37 | set { list = value; } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/HasManyToManyViaComponents.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System.Collections; 18 | 19 | [ActiveRecord] 20 | public class HasManyToManyViaComponents 21 | { 22 | private int id; 23 | private IList components = new ArrayList(); 24 | 25 | public HasManyToManyViaComponents() 26 | { 27 | } 28 | 29 | [HasMany(typeof(ComponentManyToClassA), "id", 30 | "components_to_a", Index="pos", RelationType = RelationType.List, 31 | DependentObjects = true)] 32 | public IList Components 33 | { 34 | get { return components; } 35 | set { components = value; } 36 | } 37 | 38 | [PrimaryKey] 39 | public int Id 40 | { 41 | get { return id; } 42 | set { id = value; } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/HasManyWithBadList.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | [ActiveRecord(Lazy = false)] 21 | public class HasManyWithBadList : ActiveRecordBase 22 | { 23 | private int id; 24 | private IList list; 25 | 26 | [PrimaryKey] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [HasMany(typeof(ClassA), "keycol", "ClassATable", Inverse = true, RelationType= RelationType.List)] 34 | public IList Items 35 | { 36 | get { return list; } 37 | set { list = value; } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/HasManyWithBatch.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | [ActiveRecord(Lazy = false)] 21 | public class HasManyWithBatch : ActiveRecordBase 22 | { 23 | private int id; 24 | private IList list; 25 | 26 | [PrimaryKey] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [HasMany(typeof(ClassA), "keycol", "ClassATable", Inverse = true, BatchSize = 3)] 34 | public IList Items 35 | { 36 | get { return list; } 37 | set { list = value; } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/HasManyWithFetch.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | [ActiveRecord(Lazy = false)] 21 | public class HasManyWithFetch : ActiveRecordBase 22 | { 23 | private int id; 24 | private IList list; 25 | 26 | [PrimaryKey] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [HasMany(typeof(ClassA), "keycol", "ClassATable", Inverse = true, Fetch=FetchEnum.Join)] 34 | public IList Items 35 | { 36 | get { return list; } 37 | set { list = value; } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/IdBagPrimitive.cs: -------------------------------------------------------------------------------- 1 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 2 | { 3 | using System.Collections.Generic; 4 | 5 | [ActiveRecord] 6 | public class IdBagPrimitive 7 | { 8 | private int id; 9 | private IList items; 10 | 11 | [PrimaryKey] 12 | public int Id 13 | { 14 | get { return id; } 15 | set { id = value; } 16 | } 17 | 18 | [HasAndBelongsToMany(RelationType = RelationType.IdBag, Table="IdToItems", ColumnKey="keyid", ElementType = typeof(string))] 19 | [CollectionID(CollectionIDType.Sequence, "col", "Int32")] 20 | public IList Items 21 | { 22 | get { return items; } 23 | set { items = value; } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/ImportClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord(Lazy=false), Import(typeof(ImportClassRow), "ImportClassRow")] 20 | public class ImportClass : ActiveRecordBase 21 | { 22 | private int id; 23 | private String name; 24 | 25 | [PrimaryKey] 26 | public int Id 27 | { 28 | get { return id; } 29 | set { id = value; } 30 | } 31 | 32 | [Property] 33 | public string Name 34 | { 35 | get { return name; } 36 | set { name = value; } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/JoinedSubClassWithPrimaryKey.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 15 | { 16 | using System; 17 | using System.Text; 18 | 19 | [ActiveRecord("disctablebad", Lazy = false)] 20 | public class JoinedSubClassWithPrimaryKey : BaseJoinedClass 21 | { 22 | [PrimaryKey] 23 | public int PkId 24 | { 25 | get { return 0; } 26 | set { } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/LazyClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | using System.Text; 19 | 20 | [ActiveRecord(Lazy = true)] 21 | public class LazyClass 22 | { 23 | int id; 24 | ClassWithAnyAttribute clazz; 25 | 26 | [PrimaryKey(PrimaryKeyType.Native)] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [BelongsTo] 34 | public virtual ClassWithAnyAttribute Clazz 35 | { 36 | get { return clazz; } 37 | set { clazz = value; } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/LazyClassWithoutVirtualPropertyOnBelongsTo.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | [ActiveRecord(Lazy=true)] 18 | public class LazyClassWithoutVirtualPropertyOnBelongsTo 19 | { 20 | int id; 21 | ClassWithAnyAttribute clazz; 22 | 23 | [PrimaryKey(PrimaryKeyType.Native)] 24 | public int Id 25 | { 26 | get { return id; } 27 | set { id = value; } 28 | } 29 | 30 | [BelongsTo] 31 | public ClassWithAnyAttribute Clazz 32 | { 33 | get { return clazz; } 34 | set { clazz = value; } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/Person.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord( DiscriminatorColumn="type", DiscriminatorValue="person" )] 20 | public class Person : ActiveRecordBase 21 | { 22 | } 23 | 24 | [ActiveRecord( DiscriminatorValue="customer" )] 25 | public class Customer : Person 26 | { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/SequenceParamClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | 20 | [ActiveRecord(Lazy = false)] 21 | public class SequenceParamClass : ActiveRecordBase 22 | { 23 | private int id; 24 | 25 | [PrimaryKey( PrimaryKeyType.Sequence, SequenceName="my_seq" )] 26 | public int Id 27 | { 28 | get { return id; } 29 | set { id = value; } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/SimpleNestedComponentWithFieldAccess.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | [ActiveRecord] 18 | public class SimpleNestedComponentWithFieldAccess : ActiveRecordBase 19 | { 20 | private int id; 21 | private NestedComponent nested; 22 | 23 | [PrimaryKey] 24 | public int Id 25 | { 26 | get { return id; } 27 | set { id = value; } 28 | } 29 | 30 | [Nested(Access=PropertyAccess.NosetterCamelcase)] 31 | public NestedComponent Nested 32 | { 33 | get { return nested; } 34 | set { nested = value; } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/TimestampedClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord(Lazy = false)] 20 | public class TimestampedClass : ActiveRecordBase 21 | { 22 | private int id; 23 | private String name; 24 | private int ts; 25 | 26 | [PrimaryKey] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [Property] 34 | public string Name 35 | { 36 | get { return name; } 37 | set { name = value; } 38 | } 39 | 40 | [Timestamp] 41 | public int Ts 42 | { 43 | get { return ts; } 44 | set { ts = value; } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/Tuplizer.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 17 | { 18 | using System; 19 | using NHibernate.Tuple; 20 | 21 | public class Tuplizer : ITuplizer 22 | { 23 | public object[] GetPropertyValues(object entity) 24 | { 25 | throw new System.NotImplementedException(); 26 | } 27 | 28 | public void SetPropertyValues(object entity, object[] values) 29 | { 30 | throw new System.NotImplementedException(); 31 | } 32 | 33 | public object GetPropertyValue(object entity, int i) 34 | { 35 | throw new System.NotImplementedException(); 36 | } 37 | 38 | public object Instantiate() 39 | { 40 | throw new System.NotImplementedException(); 41 | } 42 | 43 | public bool IsInstance(object obj) 44 | { 45 | throw new System.NotImplementedException(); 46 | } 47 | 48 | public Type MappedClass 49 | { 50 | get { throw new System.NotImplementedException(); } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/VersionedClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord(Lazy = false)] 20 | public class VersionedClass : ActiveRecordBase 21 | { 22 | private int id; 23 | private String name; 24 | private String ver; 25 | 26 | [PrimaryKey] 27 | public int Id 28 | { 29 | get { return id; } 30 | set { id = value; } 31 | } 32 | 33 | [Property] 34 | public string Name 35 | { 36 | get { return name; } 37 | set { name = value; } 38 | } 39 | 40 | [Version] 41 | public string Ver 42 | { 43 | get { return ver; } 44 | set { ver = value; } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Framework.Internal.Tests/Model/VersionedTimestampedClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal.Tests.Model 16 | { 17 | using System; 18 | 19 | /// 20 | /// Warning: This is a wrong definition! 21 | /// 22 | [ActiveRecord] 23 | public class VersionedTimestampedClass : ActiveRecordBase 24 | { 25 | private int id; 26 | private String name; 27 | private String ver; 28 | private int ts; 29 | 30 | [PrimaryKey] 31 | public int Id 32 | { 33 | get { return id; } 34 | set { id = value; } 35 | } 36 | 37 | [Property] 38 | public string Name 39 | { 40 | get { return name; } 41 | set { name = value; } 42 | } 43 | 44 | [Version] 45 | public string Ver 46 | { 47 | get { return ver; } 48 | set { ver = value; } 49 | } 50 | 51 | [Timestamp] 52 | public int Ts 53 | { 54 | get { return ts; } 55 | set { ts = value; } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests.Model/ActiveRecordClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | [ActiveRecord] 18 | public class ActiveRecordClass 19 | { 20 | private int id; 21 | 22 | [PrimaryKey] 23 | public virtual int Id 24 | { 25 | get { return id; } 26 | set { id = value; } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests.Model/AttributedPreLoadListener.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | using NHibernate.Event; 19 | 20 | [EventListener] 21 | public class AttributedPreLoadListener : IPreLoadEventListener 22 | { 23 | public void OnPreLoad(PreLoadEvent @event){} 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests.Model/NHibernateClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | public class NHibernateClass 18 | { 19 | private int id; 20 | 21 | public virtual int Id 22 | { 23 | get { return id; } 24 | set { id = value; } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests.Model/NonAttributedPreLoadListener.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | using NHibernate.Event; 19 | 20 | public class NonAttributedPreLoadListener: IPreLoadEventListener 21 | { 22 | public void OnPreLoad(PreLoadEvent @event){} 23 | } 24 | 25 | public class TestLoadListener : ILoadEventListener 26 | { 27 | public void OnLoad(LoadEvent @event, LoadType loadType){} 28 | } 29 | 30 | public class MultipleEventListener: IPreInsertEventListener, IPreUpdateEventListener 31 | { 32 | public bool OnPreInsert(PreInsertEvent @event) 33 | { 34 | return true; 35 | } 36 | 37 | public bool OnPreUpdate(PreUpdateEvent @event) 38 | { 39 | return true; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests.Model/Readme.txt: -------------------------------------------------------------------------------- 1 | This project exists so we will have a separate assembly which has no Active Record 2 | types in it. 3 | It is here to ensure that these tests will work: 4 | * AssemblyXmlGenerationTestCase.WillUseRegisteredAssembliesToLookForRawMappingXmlEvenIfThereAreNoActiveRecordTypesInThatAssembly 5 | * IntegrationWithNHibernateTestCase.CanIntegrateNHibernateAndActiveRecord 6 | 7 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests.Model/RegisterNHibernateClassMapping.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | [assembly: Castle.ActiveRecord.Tests.Model.RegisterNHibernateClassMapping] 16 | 17 | namespace Castle.ActiveRecord.Tests.Model 18 | { 19 | public class RegisterNHibernateClassMapping : RawXmlMappingAttribute 20 | { 21 | public override string[] GetMappings() 22 | { 23 | return new string[] 24 | { 25 | @" 26 | 27 | 28 | 29 | 30 | 31 | " 32 | }; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/AbstractActiveRecordTest.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests 16 | { 17 | using System; 18 | 19 | using NUnit.Framework; 20 | 21 | using Castle.ActiveRecord.Framework; 22 | 23 | 24 | public abstract class AbstractActiveRecordTest 25 | { 26 | protected static IConfigurationSource GetConfigSource() 27 | { 28 | return System.Configuration.ConfigurationManager.GetSection("activerecord") as IConfigurationSource; 29 | } 30 | 31 | protected static void Recreate() 32 | { 33 | ActiveRecordStarter.CreateSchema(); 34 | } 35 | 36 | [SetUp] 37 | public virtual void Init() 38 | { 39 | ActiveRecordStarter.ResetInitializationFlag(); 40 | } 41 | 42 | [TearDown] 43 | public virtual void Drop() 44 | { 45 | try 46 | { 47 | ActiveRecordStarter.DropSchema(); 48 | } 49 | catch(Exception) 50 | { 51 | 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Bugs/ARIssue293TestCase.cs: -------------------------------------------------------------------------------- 1 | namespace Castle.ActiveRecord.Tests.Bugs 2 | { 3 | using Model; 4 | using NUnit.Framework; 5 | 6 | [TestFixture] 7 | public class ARIssue293TestCase : AbstractActiveRecordTest 8 | { 9 | [Test] 10 | public void Should_execute_formula() 11 | { 12 | ActiveRecordStarter.Initialize(GetConfigSource(), typeof(Post), typeof(Blog)); 13 | Recreate(); 14 | 15 | Post.DeleteAll(); 16 | Blog.DeleteAll(); 17 | 18 | Blog blog = new Blog(); 19 | blog.Name = "hammett's blog"; 20 | blog.Author = "hamilton verissimo"; 21 | blog.Save(); 22 | 23 | var blogs = Blog.FindAll(); 24 | 25 | Assert.AreEqual(2, blogs[0].SomeFormula); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Config/AspNet2.0ConfigurationIntegration.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | using System.Collections.Generic; 17 | using System.Text; 18 | using NUnit.Framework; 19 | using Castle.ActiveRecord.Framework; 20 | using System.Configuration; 21 | using Castle.Core.Configuration; 22 | 23 | namespace Castle.ActiveRecord.Tests.Config 24 | { 25 | [TestFixture] 26 | public class AspNet2ConfigurationIntegration 27 | { 28 | [Test, Ignore("Broken on .net 3.5")] 29 | public void GetConnectionStringFromWebConfig() 30 | { 31 | IConfigurationSource source = ConfigurationManager.GetSection("activerecord-asp-net-2.0") as IConfigurationSource; 32 | 33 | IConfiguration config = source.GetConfiguration(typeof(ActiveRecordBase)); 34 | 35 | string expected = config.Children["connection.connection_string"].Value; 36 | 37 | Assert.AreEqual("Test Connection String", expected); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/FetchTestCase.cs: -------------------------------------------------------------------------------- 1 | namespace Castle.ActiveRecord.Tests 2 | { 3 | using NUnit.Framework; 4 | 5 | using Castle.ActiveRecord.Tests.Model.GenericModel; 6 | 7 | [TestFixture] 8 | public class FetchTestCase : AbstractActiveRecordTest 9 | { 10 | public override void Init() 11 | { 12 | base.Init(); 13 | 14 | ActiveRecordStarter.Initialize(GetConfigSource(), 15 | typeof(Blog), 16 | typeof(Post), 17 | typeof(Company), 18 | typeof(Award), 19 | typeof(Employee), 20 | typeof(Person)); 21 | 22 | Recreate(); 23 | 24 | Post.DeleteAll(); 25 | Blog.DeleteAll(); 26 | Company.DeleteAll(); 27 | Award.DeleteAll(); 28 | Employee.DeleteAll(); 29 | } 30 | 31 | 32 | [Test] 33 | public void FetchEnum_Join_on_a_HasMany_property_should_not_return_duplicate_records() 34 | { 35 | Blog[] blogs = Blog.FindAll(); 36 | 37 | Assert.IsNotNull(blogs); 38 | Assert.AreEqual(0, blogs.Length); 39 | 40 | var blog = new Blog() { Name = "Test blog", Author = "Eric Bowen" }; 41 | 42 | blog.Save(); 43 | 44 | var post = new Post(blog, "Post1", "Content1", "Category1"); 45 | post.Save(); 46 | 47 | blog.Posts.Add(post); 48 | 49 | var post2 = new Post(blog, "Post2", "Content2", "Category2"); 50 | post2.Save(); 51 | 52 | blog.Posts.Add(post2); 53 | 54 | blog.Save(); 55 | 56 | blogs = Blog.FindAll(); 57 | 58 | Assert.IsNotNull(blogs); 59 | Assert.AreEqual(1, blogs.Length); 60 | 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/BadPostClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | using System.Text; 19 | 20 | /// 21 | /// Used to verify that you can't map an AR class as a [Property] 22 | /// 23 | [ActiveRecord] 24 | public class BadPostClass 25 | { 26 | [Property] 27 | public Blog Blog 28 | { 29 | get { return null; } 30 | set { } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/ClassWithBrokenField.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | [ActiveRecord("ModelClassWithBrokenField")] 18 | public class ModelClassUsedToCreateTableForClassWithBrokenField : ActiveRecordBase 19 | { 20 | private int _id; 21 | 22 | [PrimaryKey] 23 | public int Id 24 | { 25 | get { return _id; } 26 | set { _id = value; } 27 | } 28 | } 29 | 30 | [ActiveRecord("ModelClassWithBrokenField")] 31 | public class ModelClassWithBrokenField : ModelClassUsedToCreateTableForClassWithBrokenField 32 | { 33 | private bool broken; 34 | 35 | [Property] 36 | public bool Broken 37 | { 38 | get { return broken; } 39 | set { broken = value; } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/Client.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord(DiscriminatorValue="client")] 20 | public class Client : Company 21 | { 22 | private Firm _firm; 23 | 24 | public Client() 25 | { 26 | } 27 | 28 | public Client(string name, Firm firm) : base(name) 29 | { 30 | _firm = firm; 31 | } 32 | 33 | [BelongsTo( "client_of" )] 34 | public Firm Firm 35 | { 36 | get { return _firm; } 37 | set { _firm = value; } 38 | } 39 | 40 | public new static void DeleteAll() 41 | { 42 | ActiveRecordBase.DeleteAll( typeof(Client) ); 43 | } 44 | 45 | public new static Client[] FindAll() 46 | { 47 | return (Client[]) ActiveRecordBase.FindAll( typeof(Client) ); 48 | } 49 | 50 | public new static Client Find(int id) 51 | { 52 | return (Client) ActiveRecordBase.FindByPrimaryKey( typeof(Client), id ); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/EnumModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System.Collections.Generic; 18 | using Castle.ActiveRecord; 19 | 20 | public enum Role 21 | { 22 | User, 23 | Admin 24 | } 25 | 26 | [ActiveRecord] 27 | public class EnumModel 28 | { 29 | private int _id; 30 | private IList _roles = new List(); 31 | 32 | [PrimaryKey] 33 | public int Id { 34 | get { return _id; } 35 | set { _id = value; } 36 | } 37 | 38 | [HasMany(Table = "Roles")] 39 | public IList Roles { 40 | get { return _roles; } 41 | set { _roles = value; } 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/Firm.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | [ActiveRecord(DiscriminatorValue="firm")] 21 | public class Firm : Company 22 | { 23 | private IList _clients; 24 | 25 | public Firm() 26 | { 27 | } 28 | 29 | public Firm(string name) : base(name) 30 | { 31 | } 32 | 33 | [HasMany( typeof(Client), ColumnKey="client_of" )] 34 | public IList Clients 35 | { 36 | get { return _clients; } 37 | set { _clients = value; } 38 | } 39 | 40 | public new static void DeleteAll() 41 | { 42 | ActiveRecordBase.DeleteAll( typeof(Firm) ); 43 | } 44 | 45 | public new static Firm[] FindAll() 46 | { 47 | return (Firm[]) ActiveRecordBase.FindAll( typeof(Firm) ); 48 | } 49 | 50 | public new static Firm Find(int id) 51 | { 52 | return (Firm) ActiveRecordBase.FindByPrimaryKey( typeof(Firm), id ); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/GenericModel/AbstractClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | namespace Castle.ActiveRecord.Tests.Model.GenericModel 17 | { 18 | [ActiveRecord(DiscriminatorValue = "AbstractClass", DiscriminatorType = "String", DiscriminatorColumn = "type")] 19 | public abstract class AbstractClass : ActiveRecordBase 20 | { 21 | private int id; 22 | 23 | [PrimaryKey] 24 | public int Id 25 | { 26 | get { return id; } 27 | set { id = value; } 28 | } 29 | } 30 | 31 | [ActiveRecord(DiscriminatorValue = "ConcreteClass")] 32 | public class ConcreteClass : AbstractClass 33 | { 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/GenericModel/NullableModel.Generics.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model.GenericModel 16 | { 17 | using System; 18 | 19 | [ActiveRecord] 20 | public class GenericNullableModel : ActiveRecordBase 21 | { 22 | private int id; 23 | private Int32? age; 24 | private DateTime? completion; 25 | private Boolean? accepted; 26 | 27 | public GenericNullableModel() {} 28 | 29 | [PrimaryKey] 30 | public int Id 31 | { 32 | get { return id; } 33 | set { id = value; } 34 | } 35 | 36 | [Property] 37 | public Int32? Age 38 | { 39 | get { return age; } 40 | set { age = value; } 41 | } 42 | 43 | [Property] 44 | public DateTime? Completion 45 | { 46 | get { return completion; } 47 | set { completion = value; } 48 | } 49 | 50 | [Property] 51 | public Boolean? Accepted 52 | { 53 | get { return accepted; } 54 | set { accepted = value; } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/GenericModel/Person.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model.GenericModel 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | [ActiveRecord("People")] 21 | public class Person : ActiveRecordBase 22 | { 23 | private int _id; 24 | private String _name; 25 | private IList _companies; 26 | 27 | public Person() 28 | { 29 | _companies = new ArrayList(); 30 | } 31 | 32 | [PrimaryKey] 33 | public int Id 34 | { 35 | get { return _id; } 36 | set { _id = value; } 37 | } 38 | 39 | [Property] 40 | public string Name 41 | { 42 | get { return _name; } 43 | set { _name = value; } 44 | } 45 | 46 | [HasAndBelongsToMany( typeof(Company), RelationType.Bag, Table="PeopleCompanies", ColumnRef="company_id", ColumnKey="person_id" )] 47 | public IList Companies 48 | { 49 | get { return _companies; } 50 | set { _companies = value; } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/Hand.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | [ActiveRecord("Hands")] 18 | public class Hand : Test2ARBase 19 | { 20 | private int _id; 21 | private string _side; 22 | 23 | public Hand() 24 | { 25 | } 26 | 27 | [PrimaryKey(PrimaryKeyType.Identity)] 28 | public int Id 29 | { 30 | get { return _id; } 31 | set { _id = value; } 32 | } 33 | 34 | [Property] 35 | public string Side 36 | { 37 | get { return _side; } 38 | set { _side = value; } 39 | } 40 | 41 | public static Hand[] FindAll() 42 | { 43 | return (Hand[]) ActiveRecordBase.FindAll(typeof (Hand)); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/IntlName.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | [ActiveRecord] 21 | public class IntlName : ActiveRecordBase 22 | { 23 | private int id; 24 | private IDictionary snippet = new Hashtable(); 25 | 26 | public IntlName() 27 | { 28 | } 29 | 30 | [PrimaryKey] 31 | public int Id 32 | { 33 | get { return id; } 34 | set { id = value; } 35 | } 36 | 37 | [HasMany(typeof (Snippet), ColumnKey="refid", Index="langcode", IndexType="string")] 38 | public IDictionary Snippet 39 | { 40 | get { return snippet; } 41 | set { snippet = value; } 42 | } 43 | 44 | public void AddSnippet(String lang, String text) 45 | { 46 | //Snippet[ lang ] = text; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/LazyObjectWithLazyBlobProperty.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model { 16 | [ActiveRecord(Lazy = true)] 17 | public class LazyObjectWithLazyBlobProperty 18 | { 19 | private int id; 20 | private byte[] blobdata; 21 | 22 | [PrimaryKey] 23 | public virtual int Id 24 | { 25 | get { return id; } 26 | set { id = value; } 27 | } 28 | 29 | [Property(Lazy = true, ColumnType="BinaryBlob")] 30 | public virtual byte[] BlobData 31 | { 32 | get { return blobdata; } 33 | set { blobdata = value; } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/LineItem.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | 19 | 20 | [ActiveRecord("Line_Item")] 21 | public class LineItem : ActiveRecordBase 22 | { 23 | private int id; 24 | private int quantity; 25 | 26 | [PrimaryKey(PrimaryKeyType.Native, "line_number")] 27 | public int ID 28 | { 29 | get { return this.id; } 30 | set { this.id = value; } 31 | } 32 | 33 | [Property()] 34 | public int Quantity 35 | { 36 | get { return this.quantity; } 37 | set { this.quantity = value; } 38 | } 39 | 40 | public static LineItem Find(int id) 41 | { 42 | return ((LineItem) (ActiveRecordBase.FindByPrimaryKey(typeof (LineItem), id))); 43 | } 44 | 45 | public static void DeleteAll() 46 | { 47 | ActiveRecordBase.DeleteAll(typeof (LineItem)); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/MultipleDBWithMediator/UserDB.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model.MultipleDBWithMediator 16 | { 17 | public abstract class UserDB 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/ObjectWithLazyAssociation.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | [ActiveRecord] 18 | public class ObjectWithLazyAssociation : ScopelessLazy 19 | { 20 | private int id; 21 | private VeryLazyObject2 lazyObj; 22 | 23 | [PrimaryKey] 24 | public int Id 25 | { 26 | get { return id; } 27 | set { id = value; } 28 | } 29 | 30 | [BelongsTo(Lazy = FetchWhen.OnInvoke)] 31 | public VeryLazyObject2 LazyObj 32 | { 33 | get { return lazyObj; } 34 | set { lazyObj = value; } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/Octopus.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | [ActiveRecord] 18 | public class Octopus 19 | { 20 | private int _id; 21 | 22 | [PrimaryKey(PrimaryKeyType.Native)] 23 | public int Id 24 | { 25 | get { return _id; } 26 | set { _id = value; } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/ProductWithGuid.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord] 20 | public class ProductWithGuid : ActiveRecordBase 21 | { 22 | private int _id; 23 | private Guid key; 24 | 25 | [PrimaryKey(PrimaryKeyType.Native)] 26 | public int Id 27 | { 28 | get { return _id; } 29 | set { _id = value; } 30 | } 31 | 32 | [Property("`Key`")] 33 | public Guid Key 34 | { 35 | get { return key; } 36 | set { key = value; } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/SSAFEntity.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord] 20 | class SSAFEntity : ActiveRecordBase 21 | { 22 | private Guid id; 23 | [PrimaryKey(PrimaryKeyType.GuidComb)] 24 | public Guid Id 25 | { 26 | get { return id; } 27 | set { id = value; } 28 | } 29 | 30 | private string content; 31 | 32 | [Property] 33 | public virtual string Content 34 | { 35 | get { return content; } 36 | set { content = value; } 37 | } 38 | 39 | public SSAFEntity() { } 40 | public SSAFEntity(string content) 41 | { 42 | this.content = content; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/ScopelessLazy.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | public abstract class ScopelessLazy 18 | { 19 | 20 | } 21 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/Ship.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | [ActiveRecord("ShipTable")] 18 | public class Ship 19 | { 20 | private int id; 21 | private string name; 22 | [PrimaryKey] 23 | public int Id 24 | { 25 | get { return id; } 26 | set { id = value; } 27 | } 28 | [Property] 29 | public string Name 30 | { 31 | get { return name; } 32 | set { name = value; } 33 | } 34 | } 35 | 36 | [ActiveRecord("ShipTable")] 37 | public class ShipWithBorkenField : Ship 38 | { 39 | private int passangers; 40 | [Property] 41 | public int Passangers 42 | { 43 | get { return passangers; } 44 | set { passangers = value; } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/SimpleBlog.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System.Collections.Generic; 18 | 19 | [ActiveRecord] 20 | class SimpleBlog : ActiveRecordBase 21 | { 22 | [PrimaryKey] 23 | public int Id { get; set; } 24 | 25 | [Property] 26 | public string Name { get; set; } 27 | 28 | private IList posts = new List(); 29 | [HasMany] 30 | public IList Posts { get { return posts; } set { posts = value; } } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/SimpleModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord("TableNameHere")] 20 | public class SimpleModel 21 | { 22 | private int _id; 23 | private String _name; 24 | 25 | [PrimaryKey(PrimaryKeyType.Assigned, "t_id")] 26 | public int id 27 | { 28 | get { return _id; } 29 | set { _id = value; } 30 | } 31 | 32 | [PropertyAttribute("t_name")] 33 | public String name 34 | { 35 | get { return _name; } 36 | set { _name = value; } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/SimpleModel2.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord("TableNameHere")] 20 | public class SimpleModel2 21 | { 22 | private int _id; 23 | private String _name; 24 | 25 | [PrimaryKey(PrimaryKeyType.Native, "t_id")] 26 | public int id 27 | { 28 | get { return _id; } 29 | set { _id = value; } 30 | } 31 | 32 | [PropertyAttribute("t_name", ColumnType="StringClob")] 33 | public String name 34 | { 35 | get { return _name; } 36 | set { _name = value; } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/SimpleModel3.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord("TableNameHere")] 20 | public class SimpleModel3 21 | { 22 | private int _id; 23 | private String _name; 24 | 25 | [PrimaryKey(PrimaryKeyType.Guid, "t_id")] 26 | public int id 27 | { 28 | get { return _id; } 29 | set { _id = value; } 30 | } 31 | 32 | [PropertyAttribute("t_name", ColumnType="StringClob", NotNull=true, Length=20)] 33 | public String name 34 | { 35 | get { return _name; } 36 | set { _name = value; } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/SimplePost.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | [ActiveRecord] 18 | class SimplePost : ActiveRecordBase 19 | { 20 | [PrimaryKey] 21 | public int Id { get; set; } 22 | [Property] 23 | public string Title { get; set; } 24 | [BelongsTo] 25 | public SimpleBlog Blog { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/Snippet.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord] 20 | public class Snippet : ActiveRecordBase 21 | { 22 | private int id; 23 | private int refid; 24 | private String langcode; 25 | private String text; 26 | 27 | public Snippet() 28 | { 29 | } 30 | 31 | [PrimaryKey] 32 | public int Id 33 | { 34 | get { return id; } 35 | set { id = value; } 36 | } 37 | 38 | [Property] 39 | public int Refid 40 | { 41 | get { return refid; } 42 | set { refid = value; } 43 | } 44 | 45 | [Property] 46 | public string LangCode 47 | { 48 | get { return langcode; } 49 | set { langcode = value; } 50 | } 51 | 52 | [Property] 53 | public string Text 54 | { 55 | get { return text; } 56 | set { text = value; } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/StrictModel/Repository.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model.StrictModel 16 | { 17 | using System; 18 | 19 | using Iesi.Collections; 20 | 21 | [ActiveRecord(DiscriminatorValue="1")] 22 | public class Repository : QuestionContainer 23 | { 24 | public Repository() 25 | { 26 | } 27 | 28 | public new static void DeleteAll() 29 | { 30 | ActiveRecordBase.DeleteAll(typeof(Repository)); 31 | } 32 | 33 | public static Repository[] FindAll() 34 | { 35 | return (Repository[]) ActiveRecordBase.FindAll(typeof(Repository)); 36 | } 37 | 38 | public new static Repository Find(int id) 39 | { 40 | return (Repository) ActiveRecordBase.FindByPrimaryKey(typeof(Repository), id); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/StrictModel/Survey.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model.StrictModel 16 | { 17 | using System; 18 | 19 | using Iesi.Collections; 20 | 21 | [ActiveRecord(DiscriminatorValue="2")] 22 | public class Survey : QuestionContainer 23 | { 24 | public Survey() 25 | { 26 | } 27 | 28 | #region static methods 29 | 30 | public new static void DeleteAll() 31 | { 32 | ActiveRecordBase.DeleteAll( typeof(Survey) ); 33 | } 34 | 35 | public static Survey[] FindAll() 36 | { 37 | return (Survey[]) ActiveRecordBase.FindAll( typeof(Survey) ); 38 | } 39 | 40 | public new static Survey Find(int id) 41 | { 42 | return (Survey) ActiveRecordBase.FindByPrimaryKey( typeof(Survey), id ); 43 | } 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/Test2ARBase.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | 19 | public abstract class Test2ARBase : ActiveRecordBase 20 | { 21 | public Test2ARBase() 22 | { 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/TimeStamped.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | using System; 18 | 19 | [ActiveRecord("TimeStamped_Table")] 20 | public class TimeStamped : ActiveRecordBase 21 | { 22 | private int _id; 23 | private String _name; 24 | private DateTime lastsaved; 25 | 26 | [PrimaryKey(PrimaryKeyType.Native)] 27 | public int id 28 | { 29 | get { return _id; } 30 | set { _id = value; } 31 | } 32 | 33 | [Property] 34 | public String name 35 | { 36 | get { return _name; } 37 | set { _name = value; } 38 | } 39 | 40 | [Timestamp] 41 | public DateTime LastSaved 42 | { 43 | get { return lastsaved; } 44 | set { lastsaved = value; } 45 | } 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/VeryLazyObject.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | [ActiveRecord(Lazy = true)] 18 | public class VeryLazyObject 19 | { 20 | private int id; 21 | private string title; 22 | 23 | [PrimaryKey] 24 | public virtual int Id 25 | { 26 | get { return id; } 27 | set { id = value; } 28 | } 29 | 30 | [Property] 31 | public virtual string Title 32 | { 33 | get { return title; } 34 | set { title = value; } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Model/VeryLazyObject2.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Model 16 | { 17 | [ActiveRecord(Lazy = true)] 18 | public class VeryLazyObject2 : ScopelessLazy 19 | { 20 | private int id; 21 | private string title; 22 | 23 | [PrimaryKey] 24 | public virtual int Id 25 | { 26 | get { return id; } 27 | set { id = value; } 28 | } 29 | 30 | [Property] 31 | public virtual string Title 32 | { 33 | get { return title; } 34 | set { title = value; } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/NUnitInMemoryTest.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests 16 | { 17 | using ActiveRecord.Testing; 18 | using NUnit.Framework; 19 | 20 | public abstract class NUnitInMemoryTest : InMemoryTest 21 | { 22 | [SetUp] 23 | public override void SetUp() 24 | { 25 | base.SetUp(); 26 | } 27 | 28 | [TearDown] 29 | public override void TearDown() 30 | { 31 | base.TearDown(); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/PropertyAccessTests/Project.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.PropertyAccessTests 16 | { 17 | using System.Collections.Generic; 18 | 19 | [ActiveRecord] 20 | public class Project : ActiveRecordBase 21 | { 22 | [PrimaryKey] 23 | public int Id { get; protected set; } 24 | 25 | [HasMany(Access = PropertyAccess.AutomaticProperty)] 26 | public IList Tasks { get; set; } 27 | 28 | [Property] 29 | public string Name { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/PropertyAccessTests/Task.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.PropertyAccessTests 16 | { 17 | using System; 18 | 19 | [ActiveRecord] 20 | public class Task : ActiveRecordBase 21 | { 22 | [PrimaryKey] 23 | public int Id { get; protected set; } 24 | 25 | [BelongsTo] 26 | public Project Project { get; set; } 27 | 28 | [Property] 29 | public string Name { get; set; } 30 | 31 | [Property] 32 | public DateTime? ScheduledDate { get; set; } 33 | 34 | [Property(Access=PropertyAccess.ReadOnly)] 35 | public bool IsScheduled { get { return ScheduledDate != null; } } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Validation/GenericModel/Blog.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Validation.GenericModel 16 | { 17 | using System; 18 | 19 | [ActiveRecord("Blogs2")] 20 | public class Blog2 : ActiveRecordValidationBase 21 | { 22 | private int _id; 23 | private String _name; 24 | private String _author; 25 | 26 | [PrimaryKey(PrimaryKeyType.Native)] 27 | public int Id 28 | { 29 | get { return _id; } 30 | set { _id = value; } 31 | } 32 | 33 | [Property, ValidateIsUnique] 34 | public String Name 35 | { 36 | get { return _name; } 37 | set { _name = value; } 38 | } 39 | 40 | [Property] 41 | public String Author 42 | { 43 | get { return _author; } 44 | set { _author = value; } 45 | } 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Validation/GenericModel/Customer.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Validation.GenericModel 16 | { 17 | using System; 18 | using Castle.Components.Validator; 19 | 20 | [ActiveRecord(DiscriminatorValue="y")] 21 | public class Customer : Person 22 | { 23 | private String contactName; 24 | private String phone; 25 | 26 | public Customer() 27 | { 28 | } 29 | 30 | [Property, ValidateNonEmpty] 31 | public string ContactName 32 | { 33 | get { return contactName; } 34 | set { contactName = value; } 35 | } 36 | 37 | [Property, ValidateNonEmpty] 38 | public string Phone 39 | { 40 | get { return phone; } 41 | set { phone = value; } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Validation/GenericModel/Person.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Validation.GenericModel 16 | { 17 | using System; 18 | using Castle.Components.Validator; 19 | 20 | [ActiveRecord(DiscriminatorColumn="type", DiscriminatorValue="x")] 21 | public class Person : ActiveRecordValidationBase 22 | { 23 | private int id; 24 | private String name; 25 | private int age; 26 | 27 | public Person() 28 | { 29 | } 30 | 31 | [PrimaryKey] 32 | public int Id 33 | { 34 | get { return id; } 35 | set { id = value; } 36 | } 37 | 38 | [Property, ValidateNonEmpty] 39 | public string Name 40 | { 41 | get { return name; } 42 | set { name = value; } 43 | } 44 | 45 | [Property] 46 | public int Age 47 | { 48 | get { return age; } 49 | set { age = value; } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Validation/Model/Customer.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Validation.Model 16 | { 17 | using System; 18 | using Castle.Components.Validator; 19 | 20 | [ActiveRecord(DiscriminatorValue="y")] 21 | public class Customer : Person 22 | { 23 | private String contactName; 24 | private String phone; 25 | 26 | public Customer() 27 | { 28 | } 29 | 30 | [Property, ValidateNonEmpty] 31 | public string ContactName 32 | { 33 | get { return contactName; } 34 | set { contactName = value; } 35 | } 36 | 37 | [Property, ValidateNonEmpty] 38 | public string Phone 39 | { 40 | get { return phone; } 41 | set { phone = value; } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord.Tests/Validation/Model/Person.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Tests.Validation.Model 16 | { 17 | using System; 18 | using Castle.Components.Validator; 19 | 20 | [ActiveRecord(DiscriminatorColumn="type", DiscriminatorValue="x")] 21 | public class Person : ActiveRecordValidationBase 22 | { 23 | private int id; 24 | private String name; 25 | private int age; 26 | 27 | public Person() 28 | { 29 | } 30 | 31 | [PrimaryKey] 32 | public int Id 33 | { 34 | get { return id; } 35 | set { id = value; } 36 | } 37 | 38 | [Property, ValidateNonEmpty] 39 | public string Name 40 | { 41 | get { return name; } 42 | set { name = value; } 43 | } 44 | 45 | [Property] 46 | public int Age 47 | { 48 | get { return age; } 49 | set { age = value; } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Attributes/ActiveRecordSkip.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord 16 | { 17 | using System; 18 | 19 | /// 20 | /// Denotes that the specific class - 21 | /// which is an subclass 22 | /// should not be processed by the framework 23 | /// 24 | [AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=false), Serializable] 25 | public class ActiveRecordSkipAttribute : Attribute 26 | { 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Attributes/BaseAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord 16 | { 17 | using System; 18 | 19 | /// 20 | /// Implement common properties shared by some 21 | /// attributes 22 | /// 23 | [Serializable] 24 | public abstract class BaseAttribute : WithAccessAttribute 25 | { 26 | private CacheEnum cache = CacheEnum.Undefined; 27 | private string cacheRegion; 28 | 29 | /// 30 | /// Gets or sets the cache strategy to use for this property 31 | /// 32 | public CacheEnum Cache 33 | { 34 | get { return cache; } 35 | set { cache = value; } 36 | } 37 | 38 | /// 39 | /// Gets or sets the a name for a cache region. 40 | /// 41 | /// The cache region name. 42 | public string CacheRegion 43 | { 44 | get { return cacheRegion; } 45 | set { cacheRegion = value; } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Attributes/CompositeKeyAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord 16 | { 17 | using System; 18 | 19 | /// 20 | /// Defines that the target property is a composite key 21 | /// for the scope class 22 | /// 23 | [AttributeUsage(AttributeTargets.Property), Serializable] 24 | public class CompositeKeyAttribute : WithAccessAttribute 25 | { 26 | private string unsavedValue; 27 | 28 | /// 29 | /// Gets or sets the unsaved value. 30 | /// 31 | /// The unsaved value. 32 | public string UnsavedValue 33 | { 34 | get { return unsavedValue; } 35 | set { unsavedValue = value; } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Attributes/JoinedBaseAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord 16 | { 17 | using System; 18 | 19 | /// 20 | /// Denotes that a class is the parent class of one or 21 | /// more subclasses using a join 22 | /// 23 | [AttributeUsage(AttributeTargets.Class, AllowMultiple=false), Serializable] 24 | public class JoinedBaseAttribute : Attribute 25 | { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Attributes/KeyPropertyAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord 16 | { 17 | using System; 18 | 19 | /// 20 | /// A key property for a composite key 21 | /// 22 | [AttributeUsage(AttributeTargets.Property), Serializable] 23 | public class KeyPropertyAttribute : PropertyAttribute 24 | { 25 | private String unsavedValue; 26 | 27 | /// 28 | /// Gets or sets the unsaved value. 29 | /// 30 | /// The unsaved value. 31 | public String UnsavedValue 32 | { 33 | get { return unsavedValue; } 34 | set { unsavedValue = value; } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Attributes/RawXmlMappingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord 16 | { 17 | using System; 18 | 19 | /// 20 | /// Abstract base class for custom attributes that can generate XML and return it directly. 21 | /// This allows to customize the generate the XML passed to NHibernate in a flexible way. 22 | /// 23 | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true), Serializable] 24 | public abstract class RawXmlMappingAttribute : Attribute 25 | { 26 | /// 27 | /// Get the mapping xml to add to NHibernate's configuration. 28 | /// Note that we allow to return more than a single mapping, each string is 29 | /// treated as a seperated document. 30 | /// 31 | public abstract string[] GetMappings(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/ByteCode/ProxyFactoryFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.ByteCode 16 | { 17 | using NHibernate.Bytecode; 18 | using NHibernate.Proxy; 19 | 20 | /// 21 | /// The factory infrastructure used to build AR proxy objects. 22 | /// Use this one if you want automatic session management durring proxy hydration. 23 | /// 24 | public class ProxyFactoryFactory : IProxyFactoryFactory 25 | { 26 | public IProxyFactory BuildProxyFactory() 27 | { 28 | return new ProxyFactory(); 29 | } 30 | 31 | public bool IsProxy(object entity) 32 | { 33 | return entity is INHibernateProxy; 34 | } 35 | 36 | public IProxyValidator ProxyValidator 37 | { 38 | get { return new DynProxyTypeValidator(); } 39 | } 40 | 41 | public bool IsInstrumented(System.Type entityClass) 42 | { 43 | return true; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/AbstractNHContributor.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework 16 | { 17 | using System; 18 | using NHibernate.Cfg; 19 | 20 | /// 21 | /// Defines an abstract base class for which applies 22 | /// to all root types by default. 23 | /// 24 | public abstract class AbstractNHContributor : INHContributor 25 | { 26 | 27 | private Predicate _appliesToRootType = ((type) => true); 28 | 29 | /// 30 | /// Implements 31 | /// 32 | public Predicate AppliesToRootType 33 | { 34 | get { return _appliesToRootType; } 35 | set { _appliesToRootType = value; } 36 | } 37 | 38 | /// 39 | /// The actual contribution method. 40 | /// 41 | /// The configuration to be modified. 42 | public abstract void Contribute(Configuration configuration); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Config/Configure.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using System; 16 | 17 | namespace Castle.ActiveRecord.Framework.Config 18 | { 19 | /// 20 | /// Enables the fluent configuration of ActiveRecord. 21 | /// 22 | public static class Configure 23 | { 24 | /// 25 | /// Builds a fluent configuration for general ActiveRecord settings. 26 | /// 27 | public static FluentActiveRecordConfiguration ActiveRecord 28 | { 29 | get { return new FluentActiveRecordConfiguration(); } 30 | } 31 | 32 | /// 33 | /// Builds an ActiveRecord storage specifiaction fluently. 34 | /// 35 | public static FluentStorageConfiguration Storage 36 | { 37 | get { return new FluentStorageConfiguration(); } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Config/FluentNHibernateMapping.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Config 16 | { 17 | /// 18 | /// Extension of to add FNH-mapped 19 | /// NHibernate types. 20 | /// 21 | public class FluentNHibernateMapping : IMappingSpecification 22 | { 23 | /// 24 | /// Searches for the ClassMap-types in the assembly of the specified type. 25 | /// 26 | /// The type whose assembly will be searched. 27 | /// The mapping object itself. 28 | public FluentNHibernateMapping InAssemblyOf() 29 | { 30 | return this; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Config/IDatabaseConfiguration.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Config 16 | { 17 | /// 18 | /// Defines basic NHibernate settings for a certain RDBMS. 19 | /// 20 | public interface IDatabaseConfiguration 21 | { 22 | } 23 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Config/IMappingSpecification.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Config 16 | { 17 | /// 18 | /// Extension points for adding types mapped by different ways to ActiveRecord. 19 | /// 20 | public interface IMappingSpecification 21 | { 22 | } 23 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Config/IStorageConfiguration.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Config 16 | { 17 | using System.Collections.Generic; 18 | 19 | /// 20 | /// Interface for configuration of a database storage. 21 | /// 22 | /// 23 | /// This interface is subject to further modification. If you need to implement 24 | /// this interface, please inherit from . 25 | /// 26 | public interface IStorageConfiguration 27 | { 28 | /// 29 | /// The type selections for that storage. 30 | /// 31 | IEnumerable TypeSelections { get; } 32 | 33 | /// 34 | /// Contains the name-value-pairs for the NHibernate configuration 35 | /// 36 | IDictionary ConfigurationValues { get; } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Config/MsSqlServer2000Configuration.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Config 16 | { 17 | /// 18 | /// Defines the defaults for Sql Server 2000 19 | /// 20 | public class MsSqlServer2000Configuration : IDatabaseConfiguration 21 | { 22 | } 23 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Config/MsSqlServer2005Configuration.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Config 16 | { 17 | /// 18 | /// Defines the defaults for Sql Server 2005 19 | /// 20 | public class MsSqlServer2005Configuration : IDatabaseConfiguration 21 | { 22 | } 23 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Config/StorageTypeSelection.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Config 16 | { 17 | /// 18 | /// Configuration of the types that will use a storage. 19 | /// 20 | public class StorageTypeSelection 21 | { 22 | /// 23 | /// Determines whether the selection contains all types are not 24 | /// specified elsewhere. Only one storage configuration may have 25 | /// a type selection with this property being true. 26 | /// 27 | public virtual bool Default { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Config/XmlNhibernateMapping.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Config 16 | { 17 | /// 18 | /// Extension of to add classically XML-mapped 19 | /// NHibernate types. 20 | /// 21 | public class XmlNhibernateMapping : IMappingSpecification 22 | { 23 | /// 24 | /// Searches for the XML files in the assembly of the specified type. 25 | /// 26 | /// The type whose assembly will be searched. 27 | /// The mapping object itself. 28 | public XmlNhibernateMapping InAssemblyOf() 29 | { 30 | return this; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/IWebThreadScopeInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework 16 | { 17 | /// 18 | /// Implemenation of this interface provides that is compatible 19 | /// with Session Per Request pattern. 20 | /// 21 | public interface IWebThreadScopeInfo : IThreadScopeInfo 22 | { 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/InterceptorFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework 16 | { 17 | using NHibernate; 18 | 19 | /// 20 | /// Create an interceptor for the session. 21 | /// Allow to override the default for creating the intercetor 22 | /// 23 | public class InterceptorFactory 24 | { 25 | /// 26 | /// Creates an instance of the interceptor 27 | /// 28 | public delegate IInterceptor CreateInterceptor(); 29 | 30 | /// 31 | /// Create the 32 | /// 33 | public static CreateInterceptor Create = DefaultCreateInterceptor; 34 | 35 | private static IInterceptor DefaultCreateInterceptor() 36 | { 37 | return HookDispatcher.Instance; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Internal/Constants.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal 16 | { 17 | class Constants 18 | { 19 | public const string XmlPI= ""; 20 | public const string XmlHeader = ""; 22 | 23 | public const string XmlFooter = ""; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Internal/IVisitable.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Internal 16 | { 17 | /// 18 | /// For implementing the Visitor pattern. 19 | /// All the nodes in the model implements this interface 20 | /// 21 | public interface IVisitable 22 | { 23 | /// 24 | /// Accepts the specified visitor and call the relevant IVisitor.Visit***() method 25 | /// 26 | /// The visitor. 27 | void Accept(IVisitor visitor); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Internal/Visitors/AbstractDepthFirstVisitor.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/src/Castle.ActiveRecord/Framework/Internal/Visitors/AbstractDepthFirstVisitor.cs -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Queries/IActiveRecordQuery.Generic.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord 16 | { 17 | using NHibernate; 18 | 19 | /// 20 | /// Represents an ActiveRecord Query. 21 | /// 22 | /// The resulting object type 23 | public interface IActiveRecordQuery : IActiveRecordQuery 24 | { 25 | /// 26 | /// Executes the query using specified session. 27 | /// 28 | /// The session. 29 | /// 30 | new T Execute(ISession session); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Queries/IActiveRecordQuery.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | using NHibernate; 21 | 22 | /// 23 | /// Represents an ActiveRecord Query. 24 | /// 25 | public interface IActiveRecordQuery 26 | { 27 | /// 28 | /// Gets the target type of this query 29 | /// 30 | Type RootType { get; } 31 | 32 | /// 33 | /// Executes the specified query and return the results 34 | /// 35 | /// The session to execute the query in. 36 | /// 37 | object Execute(ISession session); 38 | 39 | /// 40 | /// Enumerates over the result of the query. 41 | /// Note: Only use if you expect most of your values to already exist in the second level cache! 42 | /// 43 | IEnumerable Enumerate(ISession session); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Queries/Modifiers/IQueryModifier.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Queries.Modifiers 16 | { 17 | using NHibernate; 18 | 19 | /// 20 | /// Any object which intent to change a NHibernate query must implement 21 | /// this interface. 22 | /// 23 | public interface IQueryModifier 24 | { 25 | /// 26 | /// Applies this modifier to the query. 27 | /// 28 | /// The query 29 | void Apply(IQuery query); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Scopes/FlushAction.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord 16 | { 17 | using System; 18 | 19 | /// 20 | /// Pendent 21 | /// 22 | [Serializable] 23 | public enum FlushAction 24 | { 25 | /// 26 | /// Original behavior. Changes are persisted at the 27 | /// end or before some queries. 28 | /// 29 | Auto, 30 | /// 31 | /// Flush need to be controlled manually. Best choice 32 | /// for readonly operations 33 | /// 34 | Never, 35 | /// 36 | /// Determine the flushing behaviour from configuration. 37 | /// 38 | Config 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Scopes/IScopeConversation.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord 16 | { 17 | using NHibernate; 18 | 19 | /// 20 | /// Interface for specific conversations using the ActiveRecord 21 | /// scope machinery. 22 | /// 23 | public interface IScopeConversation : IConversation 24 | { 25 | /// 26 | /// Looks up or creates an using the 27 | /// specified . 28 | /// 29 | /// The factory to use. 30 | /// An interceptor to include. 31 | /// An open session. 32 | ISession GetSession(ISessionFactory factory, IInterceptor interceptor); 33 | } 34 | } -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/Framework/Scopes/ThreadScopeInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2004-2011 Castle Project - http://www.castleproject.org/ 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | namespace Castle.ActiveRecord.Framework.Scopes 16 | { 17 | using System; 18 | using System.Collections; 19 | 20 | /// 21 | /// This implementation will first get the current scope from the current 22 | /// thread. Do NOT use on web scenario (web applications or web services). 23 | /// 24 | public sealed class ThreadScopeInfo : AbstractThreadScopeInfo 25 | { 26 | [ThreadStatic] static Stack stack; 27 | 28 | /// 29 | /// Gets the current stack. 30 | /// 31 | /// The current stack. 32 | public override Stack CurrentStack 33 | { 34 | get 35 | { 36 | if (stack == null) 37 | { 38 | stack = new Stack(); 39 | } 40 | 41 | return stack; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Castle.ActiveRecord/PrivateAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("Castle.ActiveRecord.Web, PublicKey=002400000480000094000000060200000024000052534131000400000100010077f5e87030dadccce6902c6adab7a987bd69cb5819991531f560785eacfc89b6fcddf6bb2a00743a7194e454c0273447fc6eec36474ba8e5a3823147d214298e4f9a631b1afee1a51ffeae4672d498f14b000e3d321453cdd8ac064de7e1cf4d222b7e81f54d4fd46725370d702a05b48738cc29d09228f1aa722ae1a9ca02fb")] 4 | -------------------------------------------------------------------------------- /tools/MSBuildCommunityTasks/Ionic.Zip.Reduced.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/MSBuildCommunityTasks/Ionic.Zip.Reduced.dll -------------------------------------------------------------------------------- /tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.chm -------------------------------------------------------------------------------- /tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/MSBuildCommunityTasks/MSBuild.Community.Tasks.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/NUnitTests.nunit: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tools/NUnit/bin/agent.conf: -------------------------------------------------------------------------------- 1 | 2 | 8080 3 | . 4 | -------------------------------------------------------------------------------- /tools/NUnit/bin/agent.log.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tools/NUnit/bin/framework/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/framework/nunit.framework.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/framework/nunit.mocks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/framework/nunit.mocks.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/framework/pnunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/framework/pnunit.framework.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/launcher.log.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/Failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/Failure.png -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/Ignored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/Ignored.png -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/Inconclusive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/Inconclusive.png -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/Skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/Skipped.png -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/Success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/Success.png -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/fit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/fit.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/log4net.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/nunit-console-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/nunit-console-runner.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/nunit-gui-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/nunit-gui-runner.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/nunit.core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/nunit.core.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/nunit.core.interfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/nunit.core.interfaces.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/nunit.fixtures.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/nunit.fixtures.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/nunit.uiexception.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/nunit.uiexception.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/nunit.uikit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/nunit.uikit.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/lib/nunit.util.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/lib/nunit.util.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/nunit-agent-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/nunit-agent-x86.exe -------------------------------------------------------------------------------- /tools/NUnit/bin/nunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/nunit-agent.exe -------------------------------------------------------------------------------- /tools/NUnit/bin/nunit-console-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/nunit-console-x86.exe -------------------------------------------------------------------------------- /tools/NUnit/bin/nunit-console.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/nunit-console.exe -------------------------------------------------------------------------------- /tools/NUnit/bin/nunit-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/nunit-x86.exe -------------------------------------------------------------------------------- /tools/NUnit/bin/nunit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/nunit.exe -------------------------------------------------------------------------------- /tools/NUnit/bin/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/nunit.framework.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/pnunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/pnunit-agent.exe -------------------------------------------------------------------------------- /tools/NUnit/bin/pnunit-launcher.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/pnunit-launcher.exe -------------------------------------------------------------------------------- /tools/NUnit/bin/pnunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/pnunit.framework.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/pnunit.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/pnunit.tests.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/runFile.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/runFile.exe -------------------------------------------------------------------------------- /tools/NUnit/bin/runpnunit.bat: -------------------------------------------------------------------------------- 1 | start pnunit-agent agent.conf 2 | pnunit-launcher test.conf -------------------------------------------------------------------------------- /tools/NUnit/bin/test.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Testing 6 | 7 | 8 | Testing 9 | pnunit.tests.dll 10 | TestLibraries.Testing.EqualTo19 11 | localhost:8080 12 | 13 | ..\server 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/loadtest-assembly.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/loadtest-assembly.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/mock-assembly.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/mock-assembly.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/nonamespace-assembly.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/nonamespace-assembly.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/nunit-console.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/nunit-console.tests.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/nunit-gui.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/nunit-gui.tests.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/nunit.core.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/nunit.core.tests.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/nunit.fixtures.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/nunit.fixtures.tests.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/nunit.framework.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/nunit.framework.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/nunit.framework.tests.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/nunit.mocks.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/nunit.mocks.tests.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/nunit.uiexception.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/nunit.uiexception.tests.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/nunit.uikit.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/nunit.uikit.tests.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/nunit.util.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/nunit.util.tests.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/test-assembly.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/test-assembly.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/test-utilities.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/test-utilities.dll -------------------------------------------------------------------------------- /tools/NUnit/bin/tests/timing-tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/bin/tests/timing-tests.dll -------------------------------------------------------------------------------- /tools/NUnit/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/castleproject-deprecated/ActiveRecord/f8d3ef171a791806bdf5634668fb6d67a3f8f58d/tools/NUnit/license.txt --------------------------------------------------------------------------------