querydsl 自动生成表插件

 

在pom中加入以下代码:

 

<build>
		<plugins>
			<plugin>
				<groupId>com.mysema.querydsl</groupId>
				<artifactId>querydsl-maven-plugin</artifactId>
				<version>${querydsl.version}</version>
				<executions>
					<execution>
						<goals>
							<goal>export</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<jdbcDriver>com.mysql.jdbc.Driver</jdbcDriver>
					<jdbcUrl>jdbc:mysql://192.168.1.151:3306/db_nono</jdbcUrl>
					<jdbcUser>nonobank</jdbcUser>
					<jdbcPassword>nonobank!@#</jdbcPassword>
					<packageName>com.nonobank.credit.domain</packageName>
					<targetFolder>${project.basedir}/target/generated-sources </targetFolder>
					<exportBeans>true</exportBeans>
					<tableNamePattern>
                        bill_repayment_history
                    </tableNamePattern>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>mysql</groupId>
						<artifactId>mysql-connector-java</artifactId>
						<version>${mysql.connector.version}</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>

 

 

然后在mvn中或者m2e插件中,输入以下命令:

querydsl:test-export

 

 

 

 

你可能感兴趣的:(query)