1 package uk.co.concise.maven.hdc; 2 3 import uk.co.concise.maven.hdc.dao.HibernateUtil; 4 5 /*** 6 * Maven plugin that needs Hibernate configuration information. 7 * @author martenssonb 8 */ 9 public abstract class HibernatePlugin { 10 private String dbDriverClass; 11 private String dbUrl; 12 private String dbUser; 13 private String dbPass; 14 private String dbHibernateDialect; 15 /*** 16 * @return Returns the dbDriverClass. 17 */ 18 public String getDbDriverClass() { 19 return dbDriverClass; 20 } 21 /*** 22 * @param dbDriverClass The dbDriverClass to set. 23 */ 24 public void setDbDriverClass(String dbDriverClass) { 25 this.dbDriverClass = dbDriverClass; 26 } 27 /*** 28 * @return Returns the dbHibernateDialect. 29 */ 30 public String getDbHibernateDialect() { 31 return dbHibernateDialect; 32 } 33 /*** 34 * @param dbHibernateDialect The dbHibernateDialect to set. 35 */ 36 public void setDbHibernateDialect(String dbHibernateDialect) { 37 this.dbHibernateDialect = dbHibernateDialect; 38 } 39 /*** 40 * @return Returns the database password. 41 */ 42 public String getDbPass() { 43 return dbPass; 44 } 45 /*** 46 * @param dbPass The database password to set. 47 */ 48 public void setDbPass(String dbPass) { 49 this.dbPass = dbPass; 50 } 51 /*** 52 * @return Returns the dbUrl. 53 */ 54 public String getDbUrl() { 55 return dbUrl; 56 } 57 /*** 58 * @param dbUrl The dbUrl to set. 59 */ 60 public void setDbUrl(String dbUrl) { 61 this.dbUrl = dbUrl; 62 } 63 /*** 64 * @return Returns the dbUser. 65 */ 66 public String getDbUser() { 67 return dbUser; 68 } 69 /*** 70 * @param dbUser The dbUser to set. 71 */ 72 public void setDbUser(String dbUser) { 73 this.dbUser = dbUser; 74 } 75 /*** 76 * Configures Hibernate. Must be called after the hibernate 77 * configuration setter methods have been called, e.g. setDbUser. 78 */ 79 protected void configure() { 80 HibernateUtil.configure(getDbDriverClass(), getDbUrl(), getDbUser(), 81 getDbPass(), getDbHibernateDialect()); 82 } 83 84 }