Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8533233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:54:54+00:00 2026-06-11T09:54:54+00:00

I have an Eclass Vehicle which has an enum attribute BreakType breakType . BreakType

  • 0

I have an Eclass Vehicle which has an enum attribute BreakType breakType.

BreakType is defined in the same Ecore model as:

BreakType{
    DRUM(0), DISC(1), BLADE(2)
}

I want to set attribute breakType default to null. for that I set following properties for breakType attribute->

DefaultLiteralValue: // it's blank
Unsettable: True

Properties of BreakType enum
Default Value : DRUM=0 // this is shown in editor UI even If i remove it from xml.

What I am getting after generating gen-model and code out of it is

BreakType breakType = DRUM // attribute set with default value

How can I set it to null, by default?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:54:55+00:00Added an answer on June 11, 2026 at 9:54 am

    I don’t think you can. If you fail to provide a default value through the defaultValueLiteral property EMF automatically picks a value appropriate to the type of the attribute. For an enumerated type, it is the first literal value that it defines.

    You can always modify the generated code yourself. Or maybe you should make use of the methods generated to provide the unsettable functionality:

    void unsetAttribute();
    boolean isSetAttribute();
    

    and check for the unset state instead of the null value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have deployed numerous report parts which reference the same view however one of them
I have a simple EMF model of the following type: EClass FooGroup { EString
I'm developing an Ecore model with some invariants defined in OCL, using the OCLinEcore
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I have several classes that implement the same interface. interface IBidManager<E> where E :
I have a class test which isn't standard constructable nor assignable due to certain
I have a ASP.NET MVC 4 app with model, that contains and colection (
I have a .Net application dump which captured an exception, I'm analysing using windbg
I want to be able to have a TestUser model specifically for development and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.