@GeneratedColumn #4526
Replies: 6 comments
-
Another closely related issue: I'm starting to think it's silly to have to write I think we could make:
I know it's a bit out of character to have the DDL annotations imply stuff at the object level rather than the other way around, but it makes perfect sense in this case. |
Beta Was this translation helpful? Give feedback.
-
After discussion with @sebersole we've identified two remaining issues: The name
I now lean toward Multiple-column mappingsThis annotation is currently—like its friend There are a range of imperfect solutions to this:
Note that what we decide to do here for |
Beta Was this translation helpful? Give feedback.
-
After going down a somewhat deeper rabbit hold than anticipated, and discovering that there are reasonable ways to use |
Beta Was this translation helpful? Give feedback.
-
At first glance, I think it only makes sense to allow this on basic attributes. On that premise, I think the ability to name the column is unnecessary. Also on that premise, I think the annotation actually should be geared toward the attribute rather than the column. As you say, it describes aspects of both an typically we "push these down" to the db level. Given all of that, I'd lean towards:
|
Beta Was this translation helpful? Give feedback.
-
Though to match better with the phrasing on the SQL side, |
Beta Was this translation helpful? Give feedback.
-
@sebersole I totally missed your comments here. Do you want me to remove |
Beta Was this translation helpful? Give feedback.
-
We have a
@ColumnDefault
annotation which works nicely in conjunction with@Generated(INSERT)
. But some databases have a syntax likegenerated as (....)
which is a bit more powerful thandefault
.In #4220 I tried supporting this by adding an
as
member to@Generated
, but perhaps that's not the right place to put it. So what are the other options? A new annotation,@ColumnGeneratedAs
or@GeneratedAs
?Suggestions?
Beta Was this translation helpful? Give feedback.
All reactions