Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for table prefix #146

Open
xiaotupansy opened this issue Jul 15, 2020 · 1 comment
Open

Add support for table prefix #146

xiaotupansy opened this issue Jul 15, 2020 · 1 comment

Comments

@xiaotupansy
Copy link

Table in database:
t_User

Generated class now:
public class tUser

Expected output:
public class User

@RupertAvery
Copy link

RupertAvery commented Mar 19, 2022

I have made a pull request for this feature:

#339

A pattern will be used to extract the entity name and optionally apply a prefix or suffix. For example, if the table name is "tblEmployees", the pattern ^tbl(?<ClassName>.*?)$ will extract "Employees"

The extracted name can be prefixed or suffixed further.

To match all tables and apply a prefix, one might use the pattern ^.*?$.

example configuration in generation.yml under data > entity

    entityNamingFilters:
      - pattern: ^tbl(?<ClassName>.*?)$
        prefix: 
        suffix: 
      - pattern: ^vw(?<ClassName>.*?)$
        prefix: 
        suffix: View

In your case the configuration would be

    entityNamingFilters:
      - pattern: ^t_(?<ClassName>.*?)$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants