havingClassTag for java 1.5 enum?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, June 20, 2006 06:31 PM

Hi all, I am trying to use xdoclet to generate UserType mapping for java 1.5 enum classes using xdoclet. This is to facilitate storing enum in Hibernate. When I run the task, the havingClassTag is not being recognized. The ant target and the sample enum class is given below. Any help is appreciated. Thanks Saravanan ******************************** * Generating UserType Mappings * ******************************** ENUM CLASS: ----------- /** * This enumeration represents the server state * @genUserType */ public enum ServerState { New, ok, warning, disabled   More>>

Hi all,

I am trying to use xdoclet to generate UserType mapping for java 1.5 enum classes using xdoclet. This is to facilitate storing enum in Hibernate.

When I run the task, the havingClassTag is not being recognized. The ant target and the sample enum class is given below. Any help is appreciated.

Thanks
Saravanan


********************************
* Generating UserType Mappings *
********************************












ENUM CLASS:
-----------
/**
* This enumeration represents the server state
* @genUserType
*/
public enum ServerState
{
New, ok, warning, disabled, inaccessible, degraded, metadata_degraded, db_corrupt, unknown;

public static ServerState mapState(int state)
{
if (state == New.ordinal())
return New;
else if (state == ok.ordinal())
return ok;
else if (state == warning.ordinal())
return warning;
else if (state == disabled.ordinal())
return disabled;
else if (state == inaccessible.ordinal())
return inaccessible;
else if (state == degraded.ordinal())
return degraded;
else if (state == metadata_degraded.ordinal())
return metadata_degraded;
else if (state == db_corrupt.ordinal())
return db_corrupt;
else
return unknown;
}
}

   <<Less
About | Sitemap | Contact