Subversion Repositories bacoAlunos

Rev

Rev 1306 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
       PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
       "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="pt.estgp.estgweb.domain.Survey" table="survey" abstract="true">
        <meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta>
        <meta attribute="scope-class">public abstract</meta>
        <id name="id" type="long">
            <generator class="native"/>
        </id>
        <discriminator column="discriminator"/>
        <timestamp source="db"   name="updateDate" unsaved-value="null"/>
        <property name="title" type="string"/>
        <property name="saveDate" type="timestamp"/>
        <property name="startDate" type="timestamp"/>
        <property name="endDate" type="timestamp"/>
        <property name="type" type="string"/>
        <property name="targetRoles" type="string"/>
        <property name="statsConsultRoles" type="string"/>
        <property name="year" type="string"/>
        <property name="semester" type="string"/>
        <property name="statusPercentage" type="int"/>
        <property name="status" type="string"/>
        <property name="identifier" type="string"/>
        <many-to-one name="owner" class="pt.estgp.estgweb.domain.GenericUser" lazy="false" outer-join="true"/>
        <many-to-one name="structuralNode" class="pt.estgp.estgweb.domain.SurveyStructuralNode" lazy="false" outer-join="true"/>
        <set name="questions" lazy="true" order-by="id asc">
            <key column="survey"/>
            <one-to-many class="pt.estgp.estgweb.domain.SurveyQuestion"/>
        </set>
        <subclass name="pt.estgp.estgweb.domain.SurveyImpl" discriminator-value="SurveyImpl"/>
    </class>

    <class name="pt.estgp.estgweb.domain.SurveyStructuralNode" table="surveystructuralnode" abstract="true">
        <meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta>
        <meta attribute="scope-class">public abstract</meta>
        <id name="id" type="long">
            <generator class="native"/>
        </id>
        <discriminator column="discriminator"/>
        <property name="msg" type="string" index="msgIndex"/>
        <property name="msgKey" type="string" index="msgKeyIndex"/>
        <property name="myKey" type="string" index="myKeyIndex"/>
        <many-to-one name="parentNode" class="pt.estgp.estgweb.domain.SurveyStructuralNode" lazy="false" outer-join="true"/>
        <many-to-one name="survey" class="pt.estgp.estgweb.domain.Survey" lazy="false" outer-join="true"/>
        <set name="nodes" lazy="true" order-by="id asc">
            <key column="parentNode"/>
            <one-to-many class="pt.estgp.estgweb.domain.SurveyStructuralNode"/>
        </set>
        <set name="responses" lazy="true" order-by="id asc">
            <key column="structuralNode"/>
            <one-to-many class="pt.estgp.estgweb.domain.SurveyResponse"/>
        </set>
        <set name="graphics" lazy="true" order-by="id asc">
            <key column="structuralNode"/>
            <one-to-many class="pt.estgp.estgweb.domain.SurveyStatsGraphic"/>
        </set>
        <subclass name="pt.estgp.estgweb.domain.SurveyStructuralNodeImpl" discriminator-value="SurveyStructuralNodeImpl"/>
    </class>

    <class name="pt.estgp.estgweb.domain.SurveyResponse" table="surveyresponse" abstract="true">
        <meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta>
        <meta attribute="scope-class">public abstract</meta>
        <id name="id" type="long">
            <generator class="native"/>
        </id>
        <discriminator column="discriminator"/>
        <property name="date" type="timestamp"/>
        <property name="answered" type="boolean"/>
        <many-to-one name="structuralNode" class="pt.estgp.estgweb.domain.SurveyStructuralNode" lazy="false" outer-join="true"/>
        <many-to-one name="owner" class="pt.estgp.estgweb.domain.GenericUser" lazy="false" outer-join="true"/>
        <set name="answers" lazy="true" order-by="id asc">
            <key column="response"/>
            <one-to-many class="pt.estgp.estgweb.domain.SurveyQuestionAnswer"/>
        </set>
        <subclass name="pt.estgp.estgweb.domain.SurveyResponseImpl" discriminator-value="SurveyResponseImpl"/>
    </class>

    <class name="pt.estgp.estgweb.domain.SurveyQuestion" table="surveyquestion" abstract="true">
        <meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta>
        <meta attribute="scope-class">public abstract</meta>
        <id name="id" type="long">
            <generator class="native"/>
        </id>
        <discriminator column="discriminator"/>
        <property name="labelpt" type="string"/>
        <property name="labelen" type="string"/>
        <property name="required" type="boolean"/>
        <property name="type" type="string"/>
        <many-to-one name="survey" class="pt.estgp.estgweb.domain.Survey" lazy="false" outer-join="true"/>
        <set name="questionItems" lazy="true" order-by="id asc">
            <key column="question"/>
            <one-to-many class="pt.estgp.estgweb.domain.SurveyQuestionItem"/>
        </set>
        <set name="graphics" lazy="true" order-by="id asc">
            <key column="question"/>
            <one-to-many class="pt.estgp.estgweb.domain.SurveyStatsGraphic"/>
        </set>
        <subclass name="pt.estgp.estgweb.domain.SurveyQuestionImpl" discriminator-value="SurveyQuestionImpl"/>
    </class>

    <class name="pt.estgp.estgweb.domain.SurveyQuestionItem" table="surveyquestionitem" abstract="true">
        <meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta>
        <meta attribute="scope-class">public abstract</meta>
        <id name="id" type="long">
            <generator class="native"/>
        </id>
        <discriminator column="discriminator"/>
        <property name="labelpt" type="string"/>
        <property name="labelen" type="string"/>
        <many-to-one name="question" class="pt.estgp.estgweb.domain.SurveyQuestion" lazy="false" outer-join="true"/>
        <set name="candidadeAnswers" lazy="true" order-by="id asc">
            <key column="questionItem"/>
            <one-to-many class="pt.estgp.estgweb.domain.SurveyQuestionCandidateAnswer"/>
        </set>
        <subclass name="pt.estgp.estgweb.domain.SurveyQuestionItemImpl" discriminator-value="SurveyQuestionItemImpl"/>
    </class>

    <class name="pt.estgp.estgweb.domain.SurveyQuestionCandidateAnswer" table="surveyquestioncandidateanswer" abstract="true">
        <meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta>
        <meta attribute="scope-class">public abstract</meta>
        <id name="id" type="long">
            <generator class="native"/>
        </id>
        <discriminator column="discriminator"/>
        <property name="labelpt" type="string"/>
        <property name="labelen" type="string"/>
        <property name="type" type="string"/>
        <many-to-one name="questionItem" class="pt.estgp.estgweb.domain.SurveyQuestionItem" lazy="false" outer-join="true"/>
        <set name="answers" lazy="true" order-by="id asc">
            <key column="candidateAnswer"/>
            <one-to-many class="pt.estgp.estgweb.domain.SurveyQuestionAnswer"/>
        </set>
        <subclass name="pt.estgp.estgweb.domain.SurveyQuestionCandidateAnswerImpl" discriminator-value="SurveyQuestionCandidateAnswerImpl"/>
    </class>

    <class name="pt.estgp.estgweb.domain.SurveyQuestionAnswer" table="surveyquestionanswer" abstract="true">
        <meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta>
        <meta attribute="scope-class">public abstract</meta>
        <id name="id" type="long">
            <generator class="native"/>
        </id>
        <discriminator column="discriminator"/>
        <property name="textAnswer" type="string"/>
        <many-to-one name="candidateAnswer" class="pt.estgp.estgweb.domain.SurveyQuestionCandidateAnswer" lazy="false" outer-join="true"/>
        <many-to-one name="response" class="pt.estgp.estgweb.domain.SurveyResponse" lazy="false" outer-join="true"/>
        <subclass name="pt.estgp.estgweb.domain.SurveyQuestionAnswerImpl" discriminator-value="SurveyQuestionAnswerImpl"/>
    </class>

    <class name="pt.estgp.estgweb.domain.SurveyStatsGraphic" table="surveystatsgraphic" abstract="true">
        <meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta>
        <meta attribute="scope-class">public abstract</meta>
        <id name="id" type="long">
            <generator class="native"/>
        </id>
        <discriminator column="discriminator"/>
        <property name="identifier" type="string"/>
        <many-to-one name="question" class="pt.estgp.estgweb.domain.SurveyQuestion" lazy="false" outer-join="true"/>
        <many-to-one name="structuralNode" class="pt.estgp.estgweb.domain.SurveyStructuralNode" lazy="false" outer-join="true"/>
        <subclass name="pt.estgp.estgweb.domain.SurveyStatsGraphicImpl" discriminator-value="SurveyStatsGraphicImpl"/>
    </class>
</hibernate-mapping>