Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 848653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:58:41+00:00 2026-05-15T06:58:41+00:00

some methods in our model pojos have been annotated like this: @Column(name=cli_clipping_id, updatable=false, columnDefinition

  • 0

some methods in our model pojos have been annotated like this:

@Column(name="cli_clipping_id", updatable=false, columnDefinition = "varchar(" + ModelUtils.ID_LENGTH + ") COLLATE utf8_bin")

columnDefinition attribute is database vendor dependant, so when trying to drop schema in HSQLDB using Hibernate it fails:

[ERROR] 16 jun 12:58:42.480 PM main [org.hibernate.tool.hbm2ddl.SchemaExport]
Unexpected token: COLLATE in statement [create table cms.edi_editorial_obj (edi_uuid varchar(23) COLLATE] 

To fix this, i’m thinking on this solution (but don’t want to spend time if it isn’t possible) , at runtime, for each method column annotated:

  • Get @Column annotation
  • Create a copy of the column annotation, setting columnDefinition null using javaassist.
  • set column method annotation to the copy column annotation object overriding the old one (i don’t know it this is possible)

Is it possible to “hack” these methods this way?

Any help would be much appreciated …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:58:41+00:00Added an answer on May 15, 2026 at 6:58 am

    I don’t think the method you suggest is possible because:

    1. The annotation value which you get at runtime is actually a proxy class implementing the annotation interface. You can’t set new values to its attributes.
    2. It is not possible to set new annotation values to the classes or methods at runtime.

    However, you can move to a xml based configuration for Hibernate where you can modify the parameter from outside the code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a couple of method attributes which do some logging. Our logging code
I have some methods that are used by several classes. My idea was to
In a classes are some methods that are run synchronously. I would like them
Just random pick some methods that I have found: sforce.connection.describeSObject sforce.SearchResult sforce.sObject sforce.LeadConvert() sforce.connection.create()
So I have made a .dll containing some methods that I wish to use
I'm refactoring some code and would like to junit test some methods but they
Some background, I've been designing a user profile for our Django database system and
Suppose I have this model: public class ViewModel { [Required] public string UserInput {
I'm trying to make some changes to our Entity Framework model, which is causing
This came up during one of our retrospectives and wanted some additional feedback and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.