| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| HibernateConfiguration |
|
| 1.0;1 |
| 1 | /** | |
| 2 | * Copyright (C) 2013 Matthias Langer | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package at.ipsquare.commons.hibernate; | |
| 17 | ||
| 18 | import java.sql.Driver; | |
| 19 | import java.util.Map; | |
| 20 | ||
| 21 | import org.hibernate.dialect.Dialect; | |
| 22 | ||
| 23 | /** | |
| 24 | * The database configuration. | |
| 25 | * | |
| 26 | * </p> | |
| 27 | * See http://docs.jboss.org/hibernate/orm/4.1/devguide/en-US/html/apa.html | |
| 28 | * | |
| 29 | * @since 2.0.0 | |
| 30 | * @author Matthias Langer | |
| 31 | */ | |
| 32 | public interface HibernateConfiguration | |
| 33 | { | |
| 34 | /** | |
| 35 | * The database user. | |
| 36 | */ | |
| 37 | String getDbUser(); | |
| 38 | ||
| 39 | /** | |
| 40 | * The password for the user. | |
| 41 | */ | |
| 42 | String getDbPass(); | |
| 43 | ||
| 44 | /** | |
| 45 | * The domain classes. | |
| 46 | */ | |
| 47 | Class<?>[] getDomainClasses(); | |
| 48 | ||
| 49 | /** | |
| 50 | * The connection URL. | |
| 51 | */ | |
| 52 | String getDbConnectionUrl(); | |
| 53 | ||
| 54 | /** | |
| 55 | * The database driver. | |
| 56 | * | |
| 57 | * <h5>Note:</h5> | |
| 58 | * The class you return from this method will explicitly initialized by {@link DefaultHibernateRepository} | |
| 59 | * to avoid <a href="http://stackoverflow.com/questions/160611/cause-of-no-suitable-driver-found-for">problems</a> later on. | |
| 60 | */ | |
| 61 | Class<? extends Driver> getDbDriverClass(); | |
| 62 | ||
| 63 | /** | |
| 64 | * The hibernate dialect to use. | |
| 65 | */ | |
| 66 | Class<? extends Dialect> getDbDialectClass(); | |
| 67 | ||
| 68 | /** | |
| 69 | * The value of {@literal hibernate.hbm2ddl.auto}. | |
| 70 | * | |
| 71 | * <p/> | |
| 72 | * See <a href='http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html/ch03.html#configuration-optional'>Hibernate configuration</a>. | |
| 73 | */ | |
| 74 | HibernateHbm2dllAuto getHbm2dllAuto(); | |
| 75 | ||
| 76 | /** | |
| 77 | * A map of arbitrary hibernate configuration properties. | |
| 78 | */ | |
| 79 | Map<String, String> getProperties(); | |
| 80 | } |