Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If Play uses Hibernate, as the other answers suggest, you will have to <a href="http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/#configuration-namingstrategy" rel="noreferrer">implement a custom <code>NamingStrategy</code></a>.</p> <p>Here's a sample NamingStrategy that converts all column names from lower camel to lower case with underscores, using <a href="http://guava-libraries.googlecode.com" rel="noreferrer">Guava</a>:</p> <pre><code>public class CustomNamingStrategy extends ImprovedNamingStrategy { private static final long serialVersionUID = -306957679456120781L; @Override public String columnName(final String columnName) { return CaseFormat.LOWER_CAMEL .to(CaseFormat.LOWER_UNDERSCORE, columnName); } } </code></pre> <p>Configure it like this:</p> <blockquote> <p>add the following line to application.conf to configure the NamingStrategy </p> <p><code>hibernate.ejb.naming_strategy=&lt;your naming strategy classname&gt;</code></p> </blockquote> <p><strong>Reference:</strong></p> <ul> <li><a href="http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/#configuration-namingstrategy" rel="noreferrer">Implementing a custom <code>NamingStrategy</code> (Hibernate Reference)</a></li> <li><a href="http://docs.jboss.org/hibernate/core/3.6/javadocs/index.html?org/hibernate/cfg/NamingStrategy.html" rel="noreferrer"><code>NamingStrategy</code> (Hibernate JavaDocs)</a></li> <li><a href="http://groups.google.com/group/play-framework/browse_thread/thread/bee380c98b173199" rel="noreferrer">How to set up a different Naming Strategy (Play-Framework Google Group)</a></li> <li><a href="http://guava-libraries.googlecode.com/svn/trunk/javadoc/index.html?com/google/common/base/CaseFormat.html" rel="noreferrer"><code>CaseFormat</code> (Guava JavaDoc)</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload