Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Nullify string field after deleting its value
Nullify string field after deleting its value [message #1808802] Tue, 02 July 2019 00:17 Go to next message
Othmane Achergui is currently offline Othmane AcherguiFriend
Messages: 1
Registered: July 2019
Junior Member
Hello,

I have a problem while trying to unset field values (attributes with lower bound = 1). Putting "Unsettable = true" made no difference.

Before setting a value, the validation is correct and the application warns me about the mandatory field being empty, but not after putting something and then deleting it.

The idea is to export the data filled in the application to a SQL script and feed a DB after, so it's key not to have "" values because it will not work when trying to insert a not nullable field in the DB.

I know there is a boutton in the properties view to restore value to default, but the goal is to get the warning from the application.

To summarize: is there any way to nullify a field after deleting the value that it contained?

Thanks in advance
Re: Nullify string field after deleting its value [message #1808930 is a reply to message #1808802] Thu, 04 July 2019 16:36 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

How did you delete it?

Did you use eUnset() ?

Regards

Ed Willink
Re: Nullify string field after deleting its value [message #1808940 is a reply to message #1808930] Thu, 04 July 2019 17:33 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
It sounds like he's using the properties view...

If your question how to validate that the empty string is not considered a valid value? You'd need to define your own EDataType that wraps java.lang.String and defines a constraint for which string values you consider valid or not. Is that what you're trying to achieve?


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Read out Genmodel file
Next Topic:Wrap a mutable Java type into a Datatype?
Goto Forum:
  


Current Time: Thu Apr 25 10:07:55 GMT 2024

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

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

Back to the top