Files
2025-09-29 00:52:08 +02:00

118 lines
4.9 KiB
XML
Executable File

<?xml version="1.0" encoding="utf-8"?>
<!--
XML based configuration file for JobModel. This is set to eager loading (lazy="false") as by the time we return
the data via WCF the session is closed and it causes a crash.
This also includes multiple other job classes as joined-subclass. This is due to them being a child class of JobModel. This will
result in each job type having its own table which links to JobModel. JobModel will contain all common data and each other table will
contain the bespoke information for that job.
@see RSG.Pipeline.Automation.Database.Domain.Entities.Jobs.JobModel
-->
<hibernate-mapping assembly="RSG.Pipeline.Automation.Database.Domain" namespace="RSG.Pipeline.Automation.Database.Domain.Entities.Jobs" xmlns="urn:nhibernate-mapping-2.2" >
<class name="JobModel" table="Jobs">
<!-- BaseModel Properties -->
<id name="ID" type="guid" >
<generator class="assigned" />
</id>
<!-- Job Properties -->
<property name="ConsumedByJobID" not-null="false" />
<property name="State" not-null="true" type="string"/>
<property name="Priority" not-null="true" type="string" />
<property name="Role" not-null="true" type="string" />
<property name="CreatedAt" not-null="true" type="Timestamp" precision="6">
<column name="CreatedAt" not-null="true" sql-type="DATETIME(6)"/>
</property>
<property name="ProcessedAt" not-null="false" type="Timestamp" precision="6">
<column name="ProcessedAt" not-null="false" sql-type="DATETIME(6)"/>
</property>
<property name="ProcessingHost" not-null="false" />
<property name="CompletedAt" not-null="false" type="Timestamp" precision="6">
<column name="CompletedAt" not-null="false" sql-type="DATETIME(6)"/>
</property>
<property name="ProcessingTime" not-null="false" />
<property name="Server" not-null="false" />
<!--<property name="UserData" not-null="false" />-->
<many-to-one name="Trigger" class="RSG.Pipeline.Automation.Database.Domain.Entities.Triggers.TriggerModel"
column="TriggerId"
not-null="false" cascade="all" lazy="false" fetch="select"/>
<set name="Changes" table="JobChanges" cascade="all" lazy="false">
<key column="JobId"/>
<one-to-many class="RSG.Pipeline.Automation.Database.Domain.Entities.Change" />
</set>
<set name="PrebuildCommands" table="PrebuildCommands" lazy="false" fetch="select">
<key column="JobId"/>
<element column="Command" type="System.String"/>
</set>
<set name="PostbuildCommands" table="PostbuildCommands" lazy="false" fetch="select">
<key column="JobId"/>
<element column="Command" type="System.String"/>
</set>
<!-- Asset Builder Job -->
<joined-subclass name="AssetBuilderJobModel" table="AssetBuilderJobs">
<key column="JobId" />
<property name="EngineFlags" />
</joined-subclass>
<!-- Code Builder Job -->
<joined-subclass name="CodeBuilderJobModel" table="CodeBuilderJobs">
<key column="JobId" />
<property name="SolutionFilename" />
<property name="TargetDir" />
<property name="PublishDir" />
<property name="BuildConfig" />
<property name="Platform" />
<property name="Tool" />
<property name="Rebuild" />
<property name="SkipConsume" />
<property name="RequiresPostJobNotification" />
</joined-subclass>
<!-- Command Runner Job -->
<joined-subclass name="CommandRunnerJobModel" table="CommandRunnerJobs">
<key column="JobId" />
<property name="CommandName" />
<property name="RequiresPostJobNotification" />
<property name="BranchName" />
<property name="TargetDir" />
<property name="TargetRegex" />
<property name="PublishDir" />
<set name="Commands" table="Commands" cascade="all" lazy="false">
<key column="JobId"/>
<one-to-many class="RSG.Pipeline.Automation.Database.Domain.Entities.Jobs.CommandRunnerJobInfoModel" />
</set>
</joined-subclass>
<!-- Integrator Job-->
<!-- <joined-subclass name="IntegratorJob" table="IntegratorJobs">
<key column="JobId" />
<one-to-one name="Integration" />
<property name="SourceChangelist" />
</joined-subclass> -->
<!-- Script Builder Job-->
<joined-subclass name="ScriptBuilderJobModel" table="ScriptBuilderJobs">
<key column="JobId" />
<property name="ScriptProjectFilename" />
<property name="BuildConfig" />
<property name="Tool" />
<property name="Rebuild" />
<property name="SkipConsume" />
<property name="RequiresPostJobNotification" />
</joined-subclass>
</class>
<filter-def name="prebuild-filter" />
<filter-def name="postbuild-filter" />
<filter-def name="mainbuild-filter" />
</hibernate-mapping>