Private fields should be ignored. If columns are created for them, it must be a regression. We will check.
Public fields can be excluded by declaring then as “transient”.
If you have public getters and setters (Java bean style accessors) for a property, the property can be ignored with the following class-level annotation:
For example: the following class has public field “baz” and property “foo”. The annotation excludes the property “foo”:
@ExcludeProperty( propertyName = "foo" )
public class Bar
{
public String baz;
private String _foo;
public String getFoo()
{
return _foo;
}
public void setFoo( String value )
{
this._foo = value;
}
}
The annotation can be imported with:
import weborb.service.ExcludeProperty;
Could you please send me link to documentation about annotation? Maybe there is also functionality for using different name for class and table in Backendless for example?
Sorry, I could not reproduce this problem. Here’s my class for the data object:
package com.mbaas;
public class Foo
{
public transient static String STATICFIELD = "FooBar";
public String name;
}
And here’s the code to save it in on the backend (the backend has no table for Foo at the time when i run the code). The code is just a command prompt program. If you use the same code in Android, make sure to use the asynchronous Backendless API:
package com.mbaas;
import com.backendless.Backendless;
public class SavingObjectWithTransientField
{
public static void main( String[] args )
{
String APPLICATION_ID = "PUT-YOUR-APP-ID-HERE;
final String SECRET_KEY = "PUT-YOUR-SECRET-KEY-HERE";
Backendless.initApp( APPLICATION_ID, SECRET_KEY, "v1" );
saveObject();
}
public static void saveObject()
{
Foo foo = new Foo();
foo.name = "Chuck Norris";
Backendless.Data.of( Foo.class ).save( foo );
}
}