how to save entities with data manager without set id because auto increment
When creating an entity in Studio, use long/int identifier with value of “Identity column”:
It’s highly recommended also to add UUID trait to such entities.
So the source code will look as follows:
@JmixEntity
@Table(name = "FOO")
@Entity
public class Foo {
@Column(name = "ID", nullable = false)
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@JmixGeneratedValue
@Column(name = "UUID")
private UUID uuid;
@Column(name = "NAME")
private String name;
// getters and setters
New instances of such entities can be saved via DataManager with null ids.