|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.j256.ormlite.spring.DatabaseTypeFactory
public class DatabaseTypeFactory
Factory class suitable for Spring injections of the database type classes.
NOTE: If you are using the Spring type wiring in Java, initialize() should be called after all of the
set methods. In Spring XML, init-method="initialize" should be used.
Here is an example of spring wiring. It expects the database URL to be in ${database.url}.
<!-- our database type factory-bean -->
<bean id="databaseTypeFactory" class="com.j256.ormlite.db.DatabaseTypeFactory" init-method="initialize">
<property name="databaseUrl" value="${database.url}" />
</bean>
<bean id="databaseType" class="com.j256.ormlite.db.DatabaseType" factory-bean="databaseTypeFactory"
factory-method="getDatabaseType" />
<bean id="driverClassName" class="java.lang.String" factory-bean="databaseTypeFactory"
factory-method="getDriverClassName" />
| Constructor Summary | |
|---|---|
DatabaseTypeFactory()
|
|
| Method Summary | |
|---|---|
DatabaseType |
getDatabaseType()
Return the database type we got from the URL. |
String |
getDatabaseUrl()
Return the wired in database URL. |
String |
getDriverClassName()
Return the class name of the database driver that was determined from the URL. |
void |
initialize()
If you are using the Spring type wiring, this should be called after all of the set methods. |
void |
setDatabaseUrl(String databaseUrl)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatabaseTypeFactory()
| Method Detail |
|---|
public void initialize()
throws Exception
Exceptionpublic String getDriverClassName()
public String getDatabaseUrl()
public void setDatabaseUrl(String databaseUrl)
public DatabaseType getDatabaseType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||