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

don't support multiple primary key? #256

Open
sendreams opened this issue Dec 12, 2021 · 0 comments
Open

don't support multiple primary key? #256

sendreams opened this issue Dec 12, 2021 · 0 comments

Comments

@sendreams
Copy link

a entity with 2 primary key, the

	TableUtils.createTableIfNotExists(connectionSource, DocFolder.class);

will throw sqlexception.

java.sql.SQLException: More than 1 idField configured for class class com.ware4u.fx.db.conn.DocFolder (FieldType:name=id,class=DocFolder,FieldType:name=cls,class=DocFolder)
at com.j256.ormlite.table.TableInfo.(TableInfo.java:92)
at com.j256.ormlite.table.TableInfo.(TableInfo.java:57)
at com.j256.ormlite.dao.BaseDaoImpl.initialize(BaseDaoImpl.java:160)
at com.j256.ormlite.dao.BaseDaoImpl.(BaseDaoImpl.java:137)
at com.j256.ormlite.dao.BaseDaoImpl.(BaseDaoImpl.java:115)
at com.j256.ormlite.dao.BaseDaoImpl$5.(BaseDaoImpl.java:1063)
at com.j256.ormlite.dao.BaseDaoImpl.createDao(BaseDaoImpl.java:1063)
at com.j256.ormlite.dao.DaoManager.createDao(DaoManager.java:71)
at com.j256.ormlite.table.TableUtils.createTableIfNotExists(TableUtils.java:74)
at com.ware4u.fx.db.conn.DamengTest.createTable(DamengTest.java:40)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

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

1 participant