1

I'm trying to use ActiveJDBC with a legacy DB where tables and columns often contain hyphens in names. This works OK for SELECTs as I can quote the identifier (e.g. Model.where("\"stupid-name\" = ?", 1)). The problem arises with INSERT/UPDATE as the SQL generated by DefaultDialect doesn't quote the identifiers.

I am thinking about implementing a custom dialect for this DB type (it's Progress OpenEdge BTW) but I have a couple of questions first:

  1. would contribution of a dialect for such DB (closed-source, requires license AFAICT) be welcome in upstream ActiveJDBC?
  2. if not, can I use an externally maintained dialect?
  3. would a change to use quoted identifiers be useful for other DB types too?
ipolevoy
  • 5,432
  • 2
  • 31
  • 46
gimoh
  • 53
  • 4
  • Using double quotes for names with "special" characters is how this is defined in SQL. So if the "DefaultDialect" doesn't do, that seems like a bug to me rather than a missing feature. –  Dec 01 '15 at 12:42

1 Answers1

0

There is a way to define the table names with back tics:

@Table("`PEOPLE`") public class Person(){}

It has been tested and working with multiple databases. The names of columns are coming from the DB, so they are used to generate queries back to DB, since ActiveJDBC is a pass-through framework: http://javalite.io/pass_through_framework.

It should be easy to make changes in the framework to force a specific dialect, but we would prefer open source databases. If yours is a closed source, than you would maintain that dialect.

ipolevoy
  • 5,432
  • 2
  • 31
  • 46