GithubHelp home page GithubHelp logo

Comments (9)

MeatPopSci avatar MeatPopSci commented on August 30, 2024

from random-jpa.

MeatPopSci avatar MeatPopSci commented on August 30, 2024

from random-jpa.

kuros avatar kuros commented on August 30, 2024

Please let know few details:

  1. Which is your entityprovider (Hibernate vs EclipseLink)
  2. What version of entity provider are you using. (Exact version)

This information will help me reproduce & fix issue.

from random-jpa.

kuros avatar kuros commented on August 30, 2024

Please try out Random-JPA v0.5.4.

I have fixed the issue, hibernate versions was not backward compatible hence provide failed to load entity details, also there was a piece of code which was swallowing the actual root cause, leading to a null pointer.

Do let me know if the issue is fixed, i will close the issue.

Thanks @MeatPopSci helping me fix the issue.

from random-jpa.

jeremylima avatar jeremylima commented on August 30, 2024

I keep having problems, the issue related with MetaModelProviderImpl was fixed, but I am getting the following error:

javax.persistence.PersistenceException: org.hibernate.loader.custom.NonUniqueDiscoveredSqlAliasException: Encountered a duplicated sql alias [table_name] during auto-discovery of a native-sql query

	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)
	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)
	at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:372)
	at com.sun.proxy.$Proxy171.getResultList(Unknown Source)
	at com.github.kuros.random.jpa.provider.base.AbstractRelationshipProvider.getForeignKeyRelations(AbstractRelationshipProvider.java:38)
	at com.github.kuros.random.jpa.mapper.RelationCreator.with(RelationCreator.java:55)
	at com.github.kuros.random.jpa.JPAContextFactory.getCache(JPAContextFactory.java:119)
	at com.github.kuros.random.jpa.JPAContextFactory.generate(JPAContextFactory.java:105)
	at com.osigu.clients.cases.CreateClient.createInsurer(CreateClient.java:32)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
	at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:200)
	at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:175)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:212)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:707)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:767)
	at org.testng.TestRunner.run(TestRunner.java:617)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
	at org.testng.SuiteRunner.run(SuiteRunner.java:254)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
	at org.testng.TestNG.run(TestNG.java:1057)
	at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
Caused by: org.hibernate.loader.custom.NonUniqueDiscoveredSqlAliasException: Encountered a duplicated sql alias [table_name] during auto-discovery of a native-sql query
	at org.hibernate.loader.custom.CustomLoader.validateAliases(CustomLoader.java:513)
	at org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:490)
	at org.hibernate.loader.Loader.getResultSet(Loader.java:2125)
	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1900)
	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1876)
	at org.hibernate.loader.Loader.doQuery(Loader.java:919)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)
	at org.hibernate.loader.Loader.doList(Loader.java:2617)
	at org.hibernate.loader.Loader.doList(Loader.java:2600)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2429)
	at org.hibernate.loader.Loader.list(Loader.java:2424)
	at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:336)
	at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1967)
	at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:322)
	at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:125)
	at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
	at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)

I am using hibernate 5.0.12.Final. I have only one table in my model

These are the DLL's for the database objects:

CREATE SEQUENCE public.clients_id_seq
INCREMENT BY 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1;

CREATE TABLE public.clients (
	id int4 NOT NULL DEFAULT nextval('clients_id_seq'::regclass),
	"name" varchar(100) NOT NULL,
	created_at timestamptz NOT NULL DEFAULT now(),
	updated_at timestamptz NULL DEFAULT now(),
	PRIMARY KEY (id)
)
WITH (
	OIDS=FALSE
) ;
CREATE UNIQUE INDEX clients_name_idx1 ON clients USING btree (upper((name)::text)) ;

Let me know if you want more details.

Thanks

from random-jpa.

kuros avatar kuros commented on August 30, 2024

can you provide me Progress version.

Also, Do you get any errors while running the below queries:-

SELECT tc.table_name, kcu.column_name, ccu.table_name, ccu.column_name FROM information_schema.table_constraints AS tc JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name WHERE constraint_type = 'FOREIGN KEY';

from random-jpa.

jeremylima avatar jeremylima commented on August 30, 2024

The query is executed but it's not returning anything. The postgres connector version is: 9.1-901-1.jdbc4. Server version: PostgreSQL 9.4.5 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit

Also I changed the provider to mysql and all is working fine, the issue is with postgres.

from random-jpa.

kuros avatar kuros commented on August 30, 2024

Fixed the issue with v0.5.5

from random-jpa.

jeremylima avatar jeremylima commented on August 30, 2024

Working fine,

Thanks

from random-jpa.

Related Issues (20)

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.