Git Product home page Git Product logo

pojo-generator's People

Contributors

jukien 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

pojo-generator's Issues

POJO generator does not support H2 embedded database

We have tried to apply the POJO generator to a table in an H2 database. The POJO generator states "database not supported". I guess the supported databases are the one mentioned in the Tools > POJO Generator > JPA Mapping configuration screen. Is this right? Maybe H2 support could be added in the future?!

composite primary keys not managed properly?!

The User POJO example mentioned in the README.md documentation has a simple primary key. We wanted to apply the POJO generator to a table that has a composite primary key. The POJO generator correctly annotates the corresponding fields with @Id , but it does not autogenerate a corresponding serializable ID class that should be the value of the @IdClass annotation that is missing too in our POJO. There exists at least a second way to manage ID classes. This way is based on the @Embeddable and @EmbeddedId annotations. I have the feeling that this second way is more complicated to implement, so I would be glad if at least the first approach could be implemented.

Relation Between Tables

Good day !

There is a way to make a relation between classes based on the relations from the database ?

Like:

@Column(name = "prd_period_type_id")
private TblPeriodType prdPeriodTypeId;

TblPeriodType is a database table.

Generate POJOs for Spring framework

These two annotations needs to be used:

import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

@Table("my_cool_table")
public class MyCoolTable{
	@Column("column_in_a_table")
	private String columnInATable;
}

IDEA 2023.1: java.lang.NoClassDefFoundError: com/twelvemonkeys/util/LinkedSet

My Environment:

        IntelliJ IDEA 2023.1 (Ultimate Edition)
        Build #IU-231.8109.175, built on March 28, 2023
            fr.jukien.intellij.plugins.pojo-generator (2.3.1)
        Kotlin: 231-1.8.20-IJ8109.175
        Current Desktop: MATE

Attempting to use "POJO Generator" -> Entity" results in the following missing dependency error.
I was successfully using this plugin back in December with a different version of Intellij, so I know it can work.

java.lang.NoClassDefFoundError: com/twelvemonkeys/util/LinkedSet at fr.jukien.intellij.plugins.util.Util.getFields(Util.java:55) at fr.jukien.intellij.plugins.action.Entity.actionPerformed(Entity.java:83) at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:333) at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:307) at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:356) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:307) at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$performAction$5(ActionMenuItem.java:299) at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:225) at com.intellij.openapi.actionSystem.impl.ActionMenuItem.performAction(ActionMenuItem.java:292) at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$new$0(ActionMenuItem.java:67) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$4(ActionMenuItem.java:114) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94) at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:114) at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:526) at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:558) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6656) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385) at java.desktop/java.awt.Component.processEvent(Component.java:6421) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2804) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:790) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:763) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:761) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:760) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:666) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:614) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:569) at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:994) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:994) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92) Caused by: java.lang.ClassNotFoundException: com.twelvemonkeys.util.LinkedSet PluginClassLoader(plugin=PluginDescriptor(name=POJO Generator, id=fr.jukien.intellij.plugins.pojo-generator, descriptorPath=plugin.xml, path=~/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/231.8109.175.plugins/pojo-generator, version=2.3.1, package=null, isBundled=false), packagePrefix=null, instanceId=297, state=active) at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.kt:150) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ... 62 more

Generator option is greyed out - Exception occured

I am using 2020.2.3

com.intellij.diagnostic.PluginException: While loading class fr.jukien.intellij.plugins.action.DTO: fr/jukien/intellij/plugins/action/DTO has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 [Plugin: fr.jukien.intellij.plugins.pojo-generator]
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:261)
at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:204)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.instantiate(ActionManagerImpl.java:212)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convertStub(ActionManagerImpl.java:193)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getActionImpl(ActionManagerImpl.java:549)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getAction(ActionManagerImpl.java:537)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.preloadActions(ActionManagerImpl.java:1551)
at com.intellij.openapi.actionSystem.impl.ActionPreloader.preload(ActionPreloader.java:15)
at com.intellij.openapi.application.Preloader.lambda$preload$0(Preloader.java:84)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
at com.intellij.openapi.application.Preloader.lambda$preload$1(Preloader.java:74)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:215)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:26)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:194)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:207)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:183)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:652)
at java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:649)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:649)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.UnsupportedClassVersionError: fr/jukien/intellij/plugins/action/DTO has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:423)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:408)
at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:369)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:258)
... 30 more

composite primary keys JPA compliance and no specifics of JPA providers like Hibernate

Sorry for being late to provide feedback with respect to the composite primary key enhancement (issue #17). I have tested the @IdClass approach and it seems to works. But:

Section 2.4 of the JPA 2.1 specification defines the rules for composite primary keys. One such rule requires to override equals() and hashCode(). The JPA specification says nothing about getters and setters. Furthermore the all args constructor of the id class seems to be logical to me but JPA does not mandate this. I have the feeling that the generated id class is influenced by the choice of a JPA provider like Hibernate. Maybe you could comment on that.

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.