| 1 | // Copyright 2004-2007 Jean-Francois Poilpret |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package net.sourceforge.hivetranse.transaction.hibernate3; |
| 16 | |
| 17 | import org.apache.hivemind.Resource; |
| 18 | import org.apache.hivemind.impl.BaseLocatable; |
| 19 | import org.apache.hivemind.util.ToStringBuilder; |
| 20 | |
| 21 | /** |
| 22 | * Represents a mapping element of a <code>HibernateSettingsSchema</code>. |
| 23 | * Each instance defines a Hibernate mapping file or class of a persistent |
| 24 | * object. |
| 25 | * |
| 26 | * @author Jean-Francois Poilpret |
| 27 | */ |
| 28 | public class HibernateMappingContribution extends BaseLocatable |
| 29 | { |
| 30 | public void setMappingFile(Resource file) |
| 31 | { |
| 32 | _file = file; |
| 33 | } |
| 34 | public Resource getMappingFile() |
| 35 | { |
| 36 | return _file; |
| 37 | } |
| 38 | |
| 39 | public void setMappingClass(Class clazz) |
| 40 | { |
| 41 | _clazz = clazz; |
| 42 | } |
| 43 | public Class getMappingClass() |
| 44 | { |
| 45 | return _clazz; |
| 46 | } |
| 47 | |
| 48 | public void setMappingPackage(String mapPackage) |
| 49 | { |
| 50 | _package = mapPackage; |
| 51 | } |
| 52 | public String getMappingPackage() |
| 53 | { |
| 54 | return _package; |
| 55 | } |
| 56 | |
| 57 | public String toString() |
| 58 | { |
| 59 | ToStringBuilder builder = new ToStringBuilder(this); |
| 60 | builder.append("mappingFile", _file); |
| 61 | builder.append("mappingClass", _clazz); |
| 62 | builder.append("mappingPackage", _package); |
| 63 | return builder.toString(); |
| 64 | } |
| 65 | |
| 66 | private Resource _file; |
| 67 | private Class _clazz; |
| 68 | private String _package; |
| 69 | } |