Class UnderscoreFieldNameConverter

java.lang.Object
net.java.ao.schema.AbstractFieldNameConverter
net.java.ao.schema.UnderscoreFieldNameConverter
All Implemented Interfaces:
FieldNameConverter, FieldNameProcessor

public final class UnderscoreFieldNameConverter extends AbstractFieldNameConverter

Imposes an underscore word-separation convention upon field names. This will convert field in the following way:

Method Name Returns Entity? Field Name
getFirstName false first_name
setLastName false last_name
getCompany true company_id
isCool false cool

This converter allows for both all-lowercase and all-uppercase field name conventions. For example, depending on the configuration, getLastName may convert to "LAST_NAME".

This converter is all that is required to emulate the ActiveRecord field name conversion.

Author:
Daniel Spiewak
  • Constructor Details

    • UnderscoreFieldNameConverter

      public UnderscoreFieldNameConverter(Case fieldNameCase)
      Creates a new field name converter in which all field names will be either fully uppercase or fully lowercase.
      Parameters:
      fieldNameCase - the case to use for field names
    • UnderscoreFieldNameConverter

      public UnderscoreFieldNameConverter(Case fieldNameCase, List<FieldNameResolver> fieldNameResolvers)
  • Method Details