We don't quite have plans for what you describe. It would require Hibernate ORM to accept new entities at runtime as well. Which can be discussed.
Your problem adds an additional twist because you would want to add classes on an existing hierarchy - that requires existing structures to be made mutable.
But we are thinking of the ability to expose unmapped properties. Check out https://hibernate.atlassian.net/browse/OGM-470
Code:
{
# common to all products
"_id" : "1234-5678-0123-4567",
"name": "Binford 2000",
"description": "High performance lawnmover",
"price": "799.99",
# specific to category/type etc.
"engine power": "20 PS",
"color": "Red",
"Cut height": "100"
}
This could be mapped to a Product entity like this:
@Entity
public class Product {
@Id
private long id;
private String name;
private double description;
private BigDecimal price;
@AdditionalProperties
private Map<String, Object> additionalProperties;
// ...
}