Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
	"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping default-cascade="none" package="org.sakaiproject.tool.gradebook"
	default-lazy="false">
	<class name="org.sakaiproject.tool.gradebook.GradeMapping" table="GB_GRADE_MAP_T" discriminator-value="0">

		<id name="id" column="ID" type="long">
			<generator class="native">
				<param name="sequence">GB_GRADE_MAPPING_S</param>
			</generator>
		</id>

		<discriminator type="integer" column="OBJECT_TYPE_ID" />

		<version type="integer" name="version" column="VERSION"/>

		<many-to-one name="gradebook" class="org.sakaiproject.tool.gradebook.Gradebook" column="GRADEBOOK_ID" not-null="true"/>

		<many-to-one name="gradingScale" column="GB_GRADING_SCALE_T" not-null="false" />

		<map name="gradeMap" table="GB_GRADE_TO_PERCENT_MAPPING_T" cascade="all" lazy="false">
			<key column="GRADE_MAP_ID"/>
			<index column="LETTER_GRADE" type="string"/>
			<element column="PERCENT" type="double"/>
		</map>

		<subclass name="org.sakaiproject.tool.gradebook.PassNotPassMapping" discriminator-value="1" />
		<subclass name="org.sakaiproject.tool.gradebook.LetterGradeMapping" discriminator-value="2" />
		<subclass name="org.sakaiproject.tool.gradebook.LetterGradePlusMinusMapping" discriminator-value="3" />

	</class>

	<database-object>
		<create>create index GB_GRADE_MAP_GB_IDX on GB_GRADE_MAP_T (GRADEBOOK_ID)</create>
		<drop></drop>
		<!-- For MySQL and hsqldb, the index will be created automatically to enforce a constraint. -->
		<dialect-scope name="org.hibernate.dialect.Oracle9Dialect"/>
		<dialect-scope name="org.hibernate.dialect.OracleDialect"/>
	</database-object>
</hibernate-mapping>
New to GrepCode? Check out our FAQ X