Closed gavinking closed 1 year ago
Reviewing the spec, I'm wondering whether we should revise some restrictions on user code.
@Entity
An entity class must:
final
public
protected
But this leads me to wonder why static inner classes are prohibited?
static
@Embeddable
Embeddable classes have the same restrictions as entity classes.
But I would have expected that an embeddable class should be non-abstract.
abstract
And I don't see any reason why static inner classes should be prohibited.
A primary key class must:
Why must a primary key class be public when we don't apply this restriction to embeddables?
Is the requirement for serializability really necessary? (Yes, I remember where this came from, but I don't believe it's relevant anymore.)
Surely a primary key class should always be non-abstract.
Reviewing the spec, I'm wondering whether we should revise some restrictions on user code.
@Entity
classesAn entity class must:
final
public
/protected
)public
/protected
But this leads me to wonder why
static
inner classes are prohibited?@Embeddable
classesEmbeddable classes have the same restrictions as entity classes.
But I would have expected that an embeddable class should be non-
abstract
.And I don't see any reason why
static
inner classes should be prohibited.Primary key classes
A primary key class must:
public
public
)public
/protected
Why must a primary key class be
public
when we don't apply this restriction to embeddables?Is the requirement for serializability really necessary? (Yes, I remember where this came from, but I don't believe it's relevant anymore.)
Surely a primary key class should always be non-
abstract
.