Does blaze persistence support conversion of entity to key value pairs, also can EntityView fields have a different name than that of actual Entity
@Entity
@Table(name = "users")
public class User {
@Column
private String name;
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
private Set<UserPropertyValue> userPropertyValues = new HashSet<>();
}
@Entity
@Table(name = "user_property_values")
public class UserPropertyValue {
@Column
private String value;
@ManyToOne
JoinColumn(name = "properties_id")
private Property property;
}
@Entity
@Table(name = "properties")
public class Property {
@Id
private Long id;
@Column
private String name;
}
I Would want the EntityView something like this.
@EntityView(User.class)
interface UserView {
private String getUserName();
private HashMap<String, String> userPropertyValues();
}
Basically name is the username here and userPropertyValues should be HashMap containing:
- key as the Property -> name
- value as PropertyValues -> value
Also does it help create custom converters, say I want to change LocalDateTime to String with various different format/pattern ?