|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcolibri.test.test2.Test2
public class Test2
This second test shows how to use enumerated values and user defined data types as attributes.
enum AccommodationTypes { OneStar, TwoStars, ThreeStars, HolidayFlat, FourStars, FiveStars};for the accomodation attribute. To manage that attribute we only have to modify the TravelDescription.hbm.xml with the following code:
... <property name="Accommodation" column="Accommodation"> <type name="jcolibri.connector.databaseutils.EnumUserType"> <param name="enumClassName">jcolibri.test.test2.TravelDescription$AccommodationTypes</param> </type> </property> ...The EnumUserType class is a utility class of the connector that allows managing Enums. It recieves the class name of you enum as parameter.
<property name="Hotel" column="Hotel"> <type name="jcolibri.connector.databaseutils.GenericUserType"> <param name="className">jcolibri.test.test2.MyStringType</param> </type> </property>The GenericUserType class is the utility class that allows to manage TypeAdaptor implementations in the data base connector.
TypeAdaptor
,
TravelDescription
,
MyStringType
Constructor Summary | |
---|---|
Test2()
|
Method Summary | |
---|---|
void |
configure()
Configures the application: case base, connectors, etc. |
void |
cycle(CBRQuery query)
Executes a CBR cycle with the given query. |
static void |
main(java.lang.String[] args)
|
void |
postCycle()
Runs the code to shutdown the application. |
CBRCaseBase |
preCycle()
Runs the precyle where typically cases are read and organized into a case base. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Test2()
Method Detail |
---|
public void configure() throws ExecutionException
StandardCBRApplication
configure
in interface StandardCBRApplication
ExecutionException
public CBRCaseBase preCycle() throws ExecutionException
StandardCBRApplication
preCycle
in interface StandardCBRApplication
ExecutionException
public void cycle(CBRQuery query) throws ExecutionException
StandardCBRApplication
cycle
in interface StandardCBRApplication
ExecutionException
public void postCycle() throws ExecutionException
StandardCBRApplication
postCycle
in interface StandardCBRApplication
ExecutionException
public static void main(java.lang.String[] args)
args
-
|
GAIA - Group for Artificial Intelligence Applications http://gaia.fdi.ucm.es |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |