Package com.pyranid

Annotation Interface DatabaseColumn


Allows specification of alternate column names for resultset mapping.

Useful in situations where column names are ugly, inconsistent, or do not map well to camel-case Java property names.

For example:

 class Example {
   @DatabaseColumn({ "systok", "sys_tok" })
   UUID systemToken;

   UUID getSystemToken() {
     return systemToken;
   }

   void setSystemToken(UUID systemToken) {
     this.systemToken = systemToken;
   }
 }

 database.queryForObject("SELECT systok FROM example", Example.class);
 
Since:
1.0.0
Author:
Mark Allen
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description