Thanks for your reply and i need an id likes the 05-CS-123 so, i need an auto generated string to increment the last number, if the client want to use the assigned then how to mention in model class to assign the @Id value.
Sudhakar Oscar Alvarez-2 wrote: > > Hello, > > What's the diference between autogenerated Long key and autogenerated > String > key???, i mean, if the String is autogenerated, it's not better solution a > Long key?, but if the String key is meaningful for the end user, then you > should define assigned strategy and assign it before save. > > Best Regards > > > > 2008/12/13 sudhakargupta <[email protected]> > >> >> Thanks for your reply >> >> Is there any other way to use the auto generator for the string in mysql >> or in any other database >> >> please suggest me for this solution.. >> >> Sudhakar.. >> >> >> >> mraible wrote: >> > >> > If you're going to use Strings for the primary key, you'll have to use >> > a type of generator that doesn't increment. I've never done this, >> > hopefully someone else on this list can help you. >> > >> > Matt >> > >> > On Fri, Dec 12, 2008 at 5:39 AM, sudhakargupta >> > <[email protected]> wrote: >> >> >> >> Hi Matt... >> >> >> >> >> >> Presently i'm working with the appfuse2 struts.. In one of my table i >> >> need >> >> to use the String as a primarykey and use foreignkey relations with >> this >> >> primarykey. >> >> >> >> i created a model class primary key setters/getters are >> >> >> >> >> >> @Id >> >> private String code; >> >> >> >> private String getCode() { >> >> return this.code; >> >> } >> >> >> >> private void setCode(String code) { >> >> this.code = code; >> >> } >> >> >> >> and after that run the command like mvn appfuse:gen and creates the >> all >> >> the >> >> action classes and the jsp files. after that run the command like mvn >> >> jetty:run, then it shows the errors to create the database and to run >> the >> >> project.. >> >> >> >> it shows the errors like primarykey field must be the Long datatype.. >> >> >> >> can u please suggest me to create the database through appfuse .. >> >> >> >> >> >> Sudhakar >> >> >> >> >> >> >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/Appfuse2-Struts-problem-tp20974893s2369p20974893.html >> >> Sent from the AppFuse - User mailing list archive at Nabble.com. >> >> >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: [email protected] >> >> For additional commands, e-mail: [email protected] >> >> >> >> >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: [email protected] >> > For additional commands, e-mail: [email protected] >> > >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Appfuse2-Struts-problem-tp20974893s2369p20988292.html >> Sent from the AppFuse - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > > -- > Atentamente > Oscar Alvarez V > (09) 8416 4052 > > -- View this message in context: http://www.nabble.com/Appfuse2-Struts-problem-tp20974893s2369p21008315.html Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
