forked from openmrs/openmrs-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "TRUNK-5664 Replace User hbm mapping file with annotations (op…
…enmrs#3027)" This reverts commit 267f4df.
- Loading branch information
Showing
4 changed files
with
90 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
api/src/main/resources/org/openmrs/api/db/hibernate/User.hbm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
This Source Code Form is subject to the terms of the Mozilla Public License, | ||
v. 2.0. If a copy of the MPL was not distributed with this file, You can | ||
obtain one at http:https://mozilla.org/MPL/2.0/. OpenMRS is also distributed under | ||
the terms of the Healthcare Disclaimer located at http:https://openmrs.org/license. | ||
Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS | ||
graphic logo is a trademark of OpenMRS Inc. | ||
--> | ||
<!DOCTYPE hibernate-mapping PUBLIC | ||
"-//Hibernate/Hibernate Mapping DTD 3.0//EN" | ||
"http:https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> | ||
<hibernate-mapping package="org.openmrs"> | ||
|
||
<class name="User" table="users"> | ||
|
||
<cache usage="read-write"/> | ||
|
||
<id name="userId" type="java.lang.Integer" column="user_id" unsaved-value="0"> | ||
<generator class="native"> | ||
<param name="sequence">users_user_id_seq</param> | ||
</generator> | ||
</id> | ||
|
||
<property name="uuid" type="java.lang.String" | ||
column="uuid" length="38" unique="true" not-null="true"/> | ||
|
||
<many-to-one name="person" class="Person" column="person_id" | ||
not-null="true" lazy="false" cascade="save-update" /> | ||
|
||
<property name="systemId" type="java.lang.String" not-null="true" | ||
column="system_id" length="50"/> | ||
|
||
<property name="username" type="java.lang.String" length="50"/> | ||
|
||
<property name="email" type="java.lang.String" length="255" unique="true"/> | ||
|
||
<!--<many-to-one name="creator" class="User" not-null="true"/> | ||
--> | ||
<many-to-one name="creator" class="User" not-null="true"/> | ||
|
||
<property name="dateCreated" type="java.util.Date" column="date_created" | ||
not-null="true" length="19"/> | ||
|
||
<many-to-one name="changedBy" class="User" column="changed_by"/> | ||
|
||
<property name="dateChanged" type="java.util.Date" column="date_changed" | ||
length="19"/> | ||
|
||
<property name="retired" type="boolean" column="retired" | ||
length="1" not-null="true"/> | ||
|
||
<many-to-one name="retiredBy" class="User" column="retired_by"/> | ||
|
||
<property name="dateRetired" type="java.util.Date" column="date_retired" | ||
length="19"/> | ||
|
||
<property name="retireReason" type="java.lang.String" column="retire_reason" | ||
length="255"/> | ||
|
||
<!-- Associations --> | ||
|
||
<!-- bi-directional many-to-many association to Role --> | ||
<set name="roles" table="user_role" lazy="false" cascade="save-update,merge,evict"> | ||
<cache usage="read-write"/> | ||
<key> | ||
<column name="user_id"/> | ||
</key> | ||
<many-to-many class="Role"> | ||
<column name="role"/> | ||
</many-to-many> | ||
</set> | ||
|
||
<map name="userProperties" table="user_property" lazy="true" | ||
cascade="save-update,merge,evict"> | ||
<key column="user_id" not-null="true"/> | ||
<map-key column="property" type="java.lang.String" length="100"/> | ||
<element column="property_value" type="java.lang.String" | ||
length="255"/> | ||
</map> | ||
|
||
</class> | ||
|
||
</hibernate-mapping> |