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

<service-builder package-path="com.liferay.ide">
	<namespace>FOO</namespace>
	
	<entity name="Employee" local-service="true" remote-service="true">

		<!-- PK fields -->

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

		<column name="companyId" type="long" />

		<!-- Group instance -->

		<column name="groupId" type="long" />

		<!-- Audit fields -->

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

		<!-- Other fields -->

		<column name="name" type="String" />
		<column name="birthday" type="Date" />
		<column name="male" type="boolean" />
		<column name="id" type="String" />

		<column name="departments" type="Collection" entity="Department" mapping-table="Department_Employees" />

		<!-- Order -->

		<order by="asc">
			<order-column name="name" />
		</order>

		<!-- Finder methods -->

		<finder name="Male" return-type="Collection">
			<finder-column name="male" />
		</finder>
	</entity>

	<entity name="Department" local-service="true" remote-service="true">

		<!-- PK fields -->

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

		<column name="companyId" type="long" />

		<!-- Group instance -->

		<column name="groupId" type="long" />

		<!-- Audit fields -->

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

		<column name="employees" type="Collection" entity="Employee" mapping-table="Department_Employees" />

		<!-- Other fields -->

		<column name="name" type="String" />

		<!-- Order -->

		<order by="asc">
			<order-column name="name" />
		</order>
	</entity>
</service-builder>