Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not support Extension class #93

Closed
mercuriy94 opened this issue May 13, 2017 · 1 comment
Closed

Not support Extension class #93

mercuriy94 opened this issue May 13, 2017 · 1 comment

Comments

@mercuriy94
Copy link

mercuriy94 commented May 13, 2017

Hello!
I'm trying to make an extension class, in the end I get an error:
`Error:Execution failed for task ':app:objectbox'.

Value for value should be of type String (could not convert from class org.greenrobot.eclipse.jdt.core.dom.SimpleName). Note: only inline constants are supported.`

My code:
`
@entity
@NameInDb(value = BOX_NAME)
public class User {

public static final String BOX_NAME = "users";

public static final String FIELD_ID = "id";
public static final String FIELD_UUID = "uuid";
public static final String FIELD_NAME = "name";
public static final String FIELD_SURNAME = "surname";

@Id
@NameInDb(FIELD_ID)
protected long mId;
@NameInDb(FIELD_UUID)
protected String mUuid;
@NameInDb(FIELD_NAME)
protected String mName;
@NameInDb(FIELD_SURNAME)
protected  String mSurname;
public User() {
}

@Generated(385108689)
@Internal
/** This constructor was generated by ObjectBox and may change any time. */
public User(long mId, String mUuid, String mName, String mSurnamer) {
    this.mId = mId;
    this.mUuid = mUuid;
    this.mName = mName;
    this.mSurname = mSurname;
}

public static User newInstance(UserDto userDto) {
    User user = new User();
    user.mName = userDto.getName();
    user.mSurname = userDto.getSurname();
    return user;
}

public long getId() {
    return mId;
}

public void setId(long id) {
    mId = id;
}

public String getUuid() {
    return mUuid;
}

public void setUuid(String uuid) {
    mUuid = uuid;
}

public String getName() {
    return mName;
}

public void setName(String name) {
    mName = name;
}

public String getSurname() {
    return mSurname;
}

public void setSurname(String surname) {
    mSurname = surname;
}

}

@entity
@NameInDb(value = BOX_NAME_EXTENSIOON)
public class ExtensionUser extends User{

public static final String BOX_NAME_EXTENSIOON =  "ext";
public static final String FIELD_TEST =  "test";

@Id
@NameInDb(FIELD_ID)
protected long mId;

@NameInDb(value = FIELD_TEST)
protected String mTestField;

}

`
I'm using version 9.9.12.
Thank you for your great work.

@FabianTerhorst
Copy link

duplicate of #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants