<?xml version="1.0"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 7.4.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_7_4_0.dtd">

<service-builder auto-import-default-references="false" auto-namespace-tables="false" mvcc-enabled="true" package-path="com.liferay.dispatch">
	<author>Matija Petanjek</author>
	<namespace>Dispatch</namespace>
	<entity local-service="true" name="DispatchLog" remote-service="true">

		<!-- PK fields -->

		<column name="dispatchLogId" primary="true" type="long" />

		<!-- Audit fields -->

		<column name="companyId" type="long" />
		<column name="userId" type="long" />
		<column name="userName" type="String" />
		<column name="createDate" type="Date" />
		<column name="modifiedDate" type="Date" />

		<!-- Other fields -->

		<column name="dispatchTriggerId" type="long" />
		<column name="endDate" type="Date" />
		<column convert-null="false" name="error" type="String" />
		<column convert-null="false" name="output" type="String" />
		<column name="startDate" type="Date" />
		<column name="status" type="int" />

		<!-- Order -->

		<order by="desc">
			<order-column name="modifiedDate" />
		</order>

		<!-- Finder methods -->

		<finder name="DispatchTriggerId" return-type="Collection">
			<finder-column name="dispatchTriggerId" />
		</finder>
		<finder name="DTI_S" return-type="Collection">
			<finder-column name="dispatchTriggerId" />
			<finder-column name="status" />
		</finder>
	</entity>
	<entity external-reference-code="company" local-service="true" name="DispatchTrigger" remote-service="true" uuid="true">

		<!-- PK fields -->

		<column name="dispatchTriggerId" primary="true" type="long" />

		<!-- Audit fields -->

		<column name="companyId" type="long" />
		<column name="userId" type="long" />
		<column name="userName" type="String" />
		<column name="createDate" type="Date" />
		<column name="modifiedDate" type="Date" />

		<!-- Other fields -->

		<column name="active" type="boolean" />
		<column name="cronExpression" type="String" />
		<column name="dispatchTaskClusterMode" type="int" />
		<column name="dispatchTaskExecutorType" type="String" />
		<column name="dispatchTaskSettings" type="String" />
		<column name="endDate" type="Date" />
		<column name="name" type="String" />
		<column name="overlapAllowed" type="boolean" />
		<column name="startDate" type="Date" />
		<column name="system" type="boolean" />
		<column name="timeZoneId" type="String" />

		<!-- Order -->

		<order by="desc">
			<order-column name="modifiedDate" />
		</order>

		<!-- Finder methods -->

		<finder name="CompanyId" return-type="Collection">
			<finder-column name="companyId" />
		</finder>
		<finder name="Active" return-type="Collection">
			<finder-column name="active" />
		</finder>
		<finder name="C_U" return-type="Collection">
			<finder-column name="companyId" />
			<finder-column name="userId" />
		</finder>
		<finder name="C_DTET" return-type="Collection">
			<finder-column name="companyId" />
			<finder-column name="dispatchTaskExecutorType" />
		</finder>
		<finder name="C_N" return-type="DispatchTrigger" unique="true">
			<finder-column name="companyId" />
			<finder-column name="name" />
		</finder>
		<finder name="A_DTCM" return-type="Collection">
			<finder-column name="active" />
			<finder-column arrayable-operator="OR" name="dispatchTaskClusterMode" />
		</finder>
	</entity>
	<exceptions>
		<exception>DispatchLogStartDate</exception>
		<exception>DispatchLogStatus</exception>
		<exception>DispatchTriggerDispatchTaskExecutorType</exception>
		<exception>DispatchTriggerEndDate</exception>
		<exception>DispatchTriggerName</exception>
		<exception>DispatchTriggerScheduler</exception>
		<exception>DispatchTriggerStartDate</exception>
		<exception>DuplicateDispatchTrigger</exception>
	</exceptions>
</service-builder>