Closed gavinking closed 1 year ago
those "problems" are mostly relate to the build tool(s) being used:
OTOH I do not think we should be feeling blocked by issues in particular build tools - there are other tools having no problems with this and since Java language has package-info we should use it if it makes sense to us
@lukasj OK, then in that case I would consider this one for 3.2, since it ties in with work we already did.
Actually, a package-level annotation would also be a super nice solution to #409, IMO.
the most natural solution would be to let you declare a
@TableGenerator
or@SequenceGenerator
with noname
at the package level. And then that generator would be used as the fallback for the whole package.
If we allowed @TableGenerator
and @SequenceGenerator
the package level, the semantics would be:
name
is specified, the annotation defines a single (global) generator as usual, butname
is defaulted, the annotation is a template which defines a generator of each entity which needs one (and its name is the name of the entity, consistently to what we defined earlier).
It would be very convenient to be able to specify a "fallback" id generator to use when
@GeneratedValue
has nogenerator
member, and the entity does not explicitly declare any@TableGenerator
or@SequenceGenerator
. This fallback could even be per-GenerationType
.One way would be via a property setting, so that, for example, you could set:
But actually the most natural solution would be to let you declare a
@TableGenerator
or@SequenceGenerator
with noname
at the package level. And then that generator would be used as the fallback for the whole package.That's a great solution, but I believe @lukasj mentioned he has some problems with us using package-level annotations.