Hello,
I have a classic class “Employee”, this employee can work some days of
the week between the time x and y. I need to schedule the employees on
some job.
The employee have a “TimeOfWork”, this class has some properties:
- DayOfWeek (1 to 7)
- EndTime and StartTime (are DateTime)
The employee are “Scheduled” on some job, the class has some properties:
- DayOfWeek (1 to 7)
- EndTime and StartTime (are DateTime, don’t care about date part)
I have to schedule a job. Example : I need to find an employee working
the Monday(1), and available (not Scheduled) between 12:00 and 17:00.
Could you tell me how I can do this?
Below a section of the classes and mapping files
Thanks,
The employee mapping file:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Planning.Core.DomainModel"
namespace="Planning.Core.DomainModel" default-lazy="true">
<class name="Employee" table="Employee">
<id name="_persistenceId" column="Id" type="Guid" access="field"
unsaved-value ="00000000-0000-0000-0000-000000000000">
<generator class="guid.comb"/>
</id>
<version name="_persistenceVersion" column="RowVersion"
access="field" type="int" unsaved-value="0"/>
<property name="LastName" column="`LastName`" type="string"
length="50" not-null="true"></property>
<property name="FirstName" column="`FirstName`" type="string"
length="50" not-null="false"></property>
<property name="IsActive" column="`IsActive`" type="boolean"
not-null="true"></property>
<bag name="TypeOfWorks" generic="true" inverse="true"
cascade="all" table ="EmployeeTypeOfWork">
<key column="EmployeeId" foreign-key="FK_Employee_TypeOfWork"/>
<one-to-many class="EmployeeTypeOfWork"/>
</bag>
<bag name="TimeOfWorks" generic="true" inverse="true"
cascade="all" table ="EmployeeTimeOfWork">
<key column="EmployeeId" foreign-key="FK_Employee_DayTimeAndHourOfWork"/>
<one-to-many class="EmployeeTimeOfWork"/>
</bag>
<bag name="DayOffs" generic="true" inverse="true" cascade="all"
table ="EmployeeDayOff">
<key column="EmployeeId" foreign-key="FK_Employee_EmployeeDayOff"/>
<one-to-many class="EmployeeDayOff"/>
</bag>
<bag name="Scheduleds" generic="true" inverse="true" cascade="all"
table ="Scheduled">
<key column="EmployeeId" foreign-key="FK_Employee_Scheduled"/>
<one-to-many class="Scheduled"/>
</bag>
<many-to-one name="Language" class="Language" fetch="join"
cascade="none" column="LanguageId" not-null="false"
foreign-key="FK_Employee_Language" />
</class>
</hibernate-mapping>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---