Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » code type database value(how to define database value for code type)
code type database value [message #758158] Tue, 22 November 2011 08:01 Go to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 309
Registered: August 2011
Senior Member
Hi,

I try to use the codeType in combination with a smart field. In the (legacy) database the values are already defined. So in the database I have to deal with integer values, double values, string values etc.

Can I map the code type to alternate database values, if yes how?

Regards Bertin
Re: code type database value [message #758433 is a reply to message #758158] Wed, 23 November 2011 09:43 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 309
Registered: August 2011
Senior Member
Hi,

Somehow I missed the wiki page about the codeType http://wiki.eclipse.org/Scout/Concepts/CodeType. It works now with the help of this documentation.

Although there is some error in the New Code Type dialog. I created a codeType with a generic type String. If I try to enter a string value in the Code ID field I always get an error "code it must be a number (long)."

As a workaround I filled in a number and Finish. In the generated code I changed the ID to string, altered the value to a string value and implemented getId() correctly and it works.

Regards Bertin
Re: code type database value [message #758697 is a reply to message #758433] Thu, 24 November 2011 09:48 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 118
Registered: November 2010
Senior Member
To my mind this is a bug, because there is no limitation on the type of the id of a Code and/or a CodeType.
As you point out you need to do the correction directly in Java (maybe with the property view, I am not sure what the status is there). You can open a Bug in Bugzilla.


I wanted to add that it is not necessary to add the codes in the CodeType if you load them from a Database (with execLoadCodes(..)). [see: section "Dynamic CodeType" of the CodeType page]


For your problem, you can also consider using a LookupCall (with a LookupService using a database) The main difference is that for a LookupCall (with a LookupService executing a query in a DB) the call is resolved each time and for a CodeType there is some caching (on the client and the server). Therefore CodeType is to be used for master data (that do not change much) and LookupCall for more volatile information.


Re: code type database value [message #761571 is a reply to message #758158] Tue, 06 December 2011 17:13 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 83
Registered: September 2011
Member
Bug 364891 will be fixed for 3.8.0.

The new behaviour is described in the bug message.
Re: code type database value [message #761847 is a reply to message #761571] Wed, 07 December 2011 07:04 Go to previous message
Matthias Zimmermann is currently offline Matthias ZimmermannFriend
Messages: 83
Registered: February 2010
Member
Link to the bug 364891 .
Previous Topic:Choose a sponsored Talk for Scout
Next Topic:deploying to server
Goto Forum:
  


Current Time: Fri Nov 28 22:03:29 GMT 2014

Powered by FUDForum. Page generated in 0.01612 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software