PostgreSQL 使用注意事项

区分大小写

PostgreSQL所有的数据库标识符(表名,模式名,列明等)是区分大小写的。此外,PostgreSQL明显的偏好所有标识符使用小写字母。 如果您使用全部小写标识符的PostgreSQL,MyBatis Generator不需要任何额外的配置就会发现表并且编写正确的SQL。如果您使用混合或者大写模式,您需要适当配置MyBatis Generator:

  • 当您的表或模式是大小写混合或全部大写时,使用delimitIdentifiers配置。
  • 为每个大小写混合或大写的列可以指定 <columnOverride>元素来指定列, 或者您可以指定delimitAllColumns属性来指定所有的列。

例子1:

  <table schema="HR" tableName="Employees"
      delimitIdentifiers="true" delimitAllColumns="true"/>

例子2...

  <table schema="HR" tableName="Employees" delimitIdentifiers="true" >
    <columnOverride column="EmployeeId" delimitedColumnName="true" />
    <columnOverride column="EmployeeName" delimitedColumnName="true" />
  </table>

results matching ""

    No results matching ""