• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring JDBC Template with annotation-based bean property/column name mapping?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When using JPA you get the ability to use annotations to specify the mappings between beans/properties and tables/columns. However, for my application JPA is overkill, so I'm using Spring's JDBCTemplate capabilities.

With Spring's SimpleJdbcInsert (for example), the framework can match column names to property names for you, but ONLY if the column names match the property names exactly.

I have a database with underscore-delimited column names that match camel-case bean property names. What I want to do is specify this correspondence as annotation. Ideally it would look something like this:



I spent several hours searching the web yesterday but didn't find anything. I'd rather not write boilerplate mapping code if it can be done with annotations.

Does anything exist that works with plain JDBC templates?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out: Mapping JDBC Result set with annotation
reply
    Bookmark Topic Watch Topic
  • New Topic