Update table fails

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?

Alex.

P.S.
The following worked with BE4.

Hi Alex
Did you try to create a new Category object via our REST Console in DevConsole -> Data -> CategoryTable -> REST Console?

And also could you please provide your appId

Regards, Vlad

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 ?

You can share your appId right here.

I wouldn’t like to share my appid on WWW.
Can i send it to you i some hidden way ?

yes, you can, just send a new message to staff user
Update%20table%20fails%20-%20Android%20-%20Backendless%20Support%20Forum%202018-09-26%2010-56-12

Got it,
Can I enable NOT-NULL constraint for Name column in Category table and try to create a new Category with REST-Console?

Yes, you can.

Regards,
Alex.

Hi Vlad,
Any foundings?

Alex.

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:

Backendless.Data.mapTableToClass( “Category”, Category.class );

in the beginning of my app.
Do i have to add the @MapToProperty for each field of each table i use ?

Regards,
Alex.

Yes, you have to, if your column name starts from upper case

Thank you very much, Sergey, it worked.

Regards,
Alex.