Hello,
i have a problem adding new entity to the table. cat is member of type Category, filled by upper function.
Here is my save code:
Backendless.Persistence.save( cat, new AsyncCallback<Category>() {
public void handleResponse( Category savedCategory )
{
DataHolder.getInstance().addCategory(savedCategory);
}
@Override
public void handleFault( BackendlessFault fault )
{
// an error has occurred, the error code can be retrieved with fault.getCode()
}
});
I get following response :
“Unable to save entity, properties: Name cannot be null”
faultCode 1037.
As i can see in debugger before it activates save, the Name field of the entity has string value.
What can be the problem?
Hi Vlad,
I didn’t tried this.
I found the temporary workaround - disable constraint Not Null for the Name field.
The field Name in the SCHEMA has STRING data type. Is it possible that your system does not detects Android’s java type string as Table STRING ?
How can i send you the appid privately ?
name of your column starts from upper case, so your model should be:
public class Category
{
private String Name;
@MapToProperty( property = "Name" )
public Date getName()
{
return Name;
}
public Category setName( String Name )
{
this.Name = Name;
return this;
}
}
because with out @MapToProperty( property = "Name" ) java(android) inspector will serialize Name as name then server will not be able to find property Name
Hi Sergey,
I’m using the java classes that has been generated by the Backendless code generator.
The generated class contains the functions you wrote, but it doesn’t contains the line
Not for this field and not for others.
The only mapping i have is: