0

I'm using MySql database for Passing input to optaplanner, im creating file similar to nurserostering in optaplanner. How many tables do i need to create if i need to pass the similar data in long01.xml

Am struck on this please do give me some ideas, its my school project.

Also why is this pattern used for

<Pattern ID="0" weight="1">
      <PatternEntries>
        <PatternEntry index="0">
          <ShiftType>L</ShiftType>
          <Day>Any</Day>
        </PatternEntry>
        <PatternEntry index="1">
          <ShiftType>D</ShiftType>
          <Day>Any</Day>
        </PatternEntry>
      </PatternEntries>
    </Pattern>

1 Answer 1

0

The nurse rostering example has 2 XML formats:

  • import dir XML: defined by the research challenge. Converted to domain objects by the mapping code in the NurseRosteringImporter
  • unsolved dir XML: XStream serialized of the domain objects. So no explicit mapping code needed (beyond the @XStreamAlias annotations on the domain classes).

I believe you mention the import dir XML, but the system of the unsolved XML is far more interesting because it has minimal mapping code. NurseRosteringDAO reads/writes from unsolved XML. Following the same design, you can also read/write to a database, by using Hibernate-JPA instead of XStream:

integration overview

Go to hibernate.org to learn Hibernate with JPA annotations. Basically, you'll add some JPA annotations (such as @Entity and @ManyToOne) on your domain objects and use an EntityManager(Factory) to read/write those from the database.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.