Code Monkey home page Code Monkey logo

hbnpojogen's People

Contributors

m-szalik avatar wwadge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hbnpojogen's Issues

Enum generated with wrong encoding

Hi Wallace,
I'm working with your generator here in MiFinity.
We use database PostgreSQL with UTF-8 encoding.
I've created a table that has some data with Latin characters (Itaú, for example) and I need the equivalent ENUM to be generated with UTF-8 encoding (like the table).
However, the ENUM is generated with wrong encoding: ANSI
image

Is there any change you can make in your generator to generate UTF-8 encoding, please?
Thanks,
Fernanda.

[enhancement] Create a Release package

Hi, I found this project after some research about creating pojo from database and beign upset after noticing that the easiest way is using eclipse with one plugin, but, for who is just looking for an easy way to do its job would be really nice to just download an .jar from release and start using! I also think that if there's one release .jar the popularity of your project would increase a lot

String handling errors while generating pojos

Hi
I've tried to generate the pojos for one of my mysq databases and faced the following problems.

Stage 2: Getting commit order in 'PARTIAL' strategy
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1911)
    at com.felees.hbnpojogen.SyncUtils.getTableCatalog(SyncUtils.java:1295)
    at com.felees.hbnpojogen.SyncUtils.getCommitOrder(SyncUtils.java:159)
    at com.felees.hbnpojogen.SyncUtils.getCommitOrder(SyncUtils.java:501)
    at com.felees.hbnpojogen.HbnPojoGen.sync(HbnPojoGen.java:172)
    at com.felees.hbnpojogen.HbnPojoGen.run(HbnPojoGen.java:461)
    at com.felees.hbnpojogen.HbnPojoGen.main(HbnPojoGen.java:495)


Stage 4: Building object model
null
java.lang.NullPointerException
    at com.felees.hbnpojogen.SyncUtils.removeUnderscores(SyncUtils.java:992)
    at com.felees.hbnpojogen.obj.Clazz.setClassPackage(Clazz.java:1040)
    at com.felees.hbnpojogen.Core.buildObjectModel(Core.java:768)
    at com.felees.hbnpojogen.HbnPojoGen.sync(HbnPojoGen.java:222)
    at com.felees.hbnpojogen.HbnPojoGen.run(HbnPojoGen.java:461)
    at com.felees.hbnpojogen.HbnPojoGen.main(HbnPojoGen.java:495)
...
Stage 6: Writing interfaces
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
    at java.lang.String.substring(String.java:1907)
    at com.felees.hbnpojogen.SyncUtils.upfirstChar(SyncUtils.java:814)
    at com.felees.hbnpojogen.obj.Clazz.getDataLayerInterfaceFullClassName(Clazz.java:1617)
    at com.felees.hbnpojogen.obj.Clazz.getDataLayerImplFullClassName(Clazz.java:1516)
    at com.felees.hbnpojogen.VelocityWriters.writeClass(VelocityWriters.java:485)
    at com.felees.hbnpojogen.VelocityWriters.writeInterfaceClasses(VelocityWriters.java:767)
    at com.felees.hbnpojogen.HbnPojoGen.sync(HbnPojoGen.java:236)
    at com.felees.hbnpojogen.HbnPojoGen.run(HbnPojoGen.java:461)
    at com.felees.hbnpojogen.HbnPojoGen.main(HbnPojoGen.java:495)

How can i create entity only configuration?

Hi,
I have below configuration and i only want to generate Entity classes not dao, services and test classes. How can i skip generating those packages and files? Also i dont want my generated entities extends IPojoGenEntity, IPost classes. How can i achieve that? Your documentation is really good but i couldn't find these customization details though.
Thanks

<?xml version="1.0" encoding="ISO-8859-1" ?>
<appconfig>
	<dbType>MYSQL</dbType>
	<driver>com.mysql.jdbc.Driver</driver>
	<jdbcConnectionString>jdbc:mysql://localhost:3306/springbootblog
	</jdbcConnectionString>
	<databaseIP>localhost</databaseIP>
	<databaseCatalog>springbootblog</databaseCatalog>
	<databaseUsername>mrgenco</databaseUsername>
	<databasePassword>***</databasePassword>
	<sourceTarget>/Users/mrgenco/Documents/MRG/webapi/</sourceTarget>
	<projectName>webapi</projectName>
	<topLevel>com.mrg</topLevel>
	<libPath>src/main/resources</libPath>
	<schemaStrategy>PARTIAL</schemaStrategy>
	<resourceFolder>src/main/resources</resourceFolder>
	<sourceFolderName>src/main/java</sourceFolderName>
	<dbPackageMap>
		<map schema="DEFAULT">
			<!-- Location of hibernate objects. ${DB} will be replaced by the schema 
				under operation dynamically. -->
			<objectPackage>
				${topLevel}.${projectName}.${DB}.model
			</objectPackage>

			<!-- Location of repository objects (spring data only) -->
			<objectTableRepoPackage>
				${topLevel}.${projectName}.${DB}.repository
			</objectTableRepoPackage>


			<objectInterfacePackage skip="true">
				${topLevel}.${projectName}.model.obj.${DB}.iface
			</objectInterfacePackage>
			<!-- Location of repository factory objects. -->
			<repositoryFactoryPackage skip="true">
				${topLevel}.${projectName}.model.obj.${DB}.repository.factory
			</repositoryFactoryPackage>

			<!-- Location of hibernate DAO objects. -->
			<daoPackage skip="true">
				${topLevel}.${projectName}.model.dao.${DB}
			</daoPackage>
			<!-- Location of hibernate DAO Implementation objects. -->
			<daoImplPackage skip="true">
				${topLevel}.${projectName}.model.dao.${DB}.impl
			</daoImplPackage>

			<!-- Location of hibernate enum objects. -->
			<enumPackage skip="true" targetbase="/some/other/path">
				${topLevel}.${projectName}.enums.db.${DB}
			</enumPackage>

			<!-- Location of class subtype enum objects. -->
			<enumSubtypePackage skip="true">
				${topLevel}.${projectName}.enums.subtype.${DB}
			</enumSubtypePackage>

			<!-- Location of hibernate factory objects. -->
			<factoryPackage skip="true">
				${topLevel}.${projectName}.factories.${DB}
			</factoryPackage>
			<!-- Location of repository factory objects. -->
			<repositoryFactoryPackage skip="true">
				${topLevel}.${projectName}.factories.${DB}
			</repositoryFactoryPackage>
			<!-- Location of assorted classes -->
			<utilPackage skip="true">
				${topLevel}.${projectName}.util
			</utilPackage>

			<!-- Location of data layer objects. -->
			<dataPackage skip="true">
				${topLevel}.${projectName}.services.data
			</dataPackage>
		</map>
	</dbPackageMap>

	<enableSpringData>true</enableSpringData>
</appconfig>

PostGreSQL 10 support

I tried out generating entities with pgsql 10 and received the following exception (I can roll back to 9.6 in the meantime):

org.postgresql.util.PSQLException: ERROR: column t1.tgconstrname does not exist
Position: 113
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3477)
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedKeys(AbstractJdbc2DatabaseMetaData.java:3670)
at com.github.wwadge.hbnpojogen.SyncUtils.getCommitOrder(SyncUtils.java:229)
at com.github.wwadge.hbnpojogen.SyncUtils.getCommitOrder(SyncUtils.java:507)
at com.github.wwadge.hbnpojogen.HbnPojoGen.sync(HbnPojoGen.java:168)
at com.github.wwadge.hbnpojogen.HbnPojoGen.run(HbnPojoGen.java:448)
at com.github.wwadge.hbnpojogen.HbnPojoGen.main(HbnPojoGen.java:481)

Repositories with Spring Boot 2.0

The repositories that are generated, e.g. ApplicationUserRepository, look like the following:

public interface ApplicationUserRepository extends JpaRepository<ApplicationUser, Long>, QueryDslPredicateExecutor<ApplicationUser> {

In Spring Boot 2, the Query DSL predicate executor changes to the following:

import org.springframework.data.querydsl.QuerydslPredicateExecutor;
Changing the extends to use the lowercase convention fixes the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.