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

jdk11 support #97

Closed
georgemoralis opened this issue Oct 13, 2020 · 11 comments
Closed

jdk11 support #97

georgemoralis opened this issue Oct 13, 2020 · 11 comments

Comments

@georgemoralis
Copy link

Are there any plans to support jdk11+ ?

@my2iu
Copy link
Owner

my2iu commented Oct 13, 2020

I’ve been told that Jinq works fine on jdk11+. I haven’t done any extensive testing myself on newer jdks or with modules though.

@georgemoralis
Copy link
Author

getting the following error with jdk15

gr/codebb/protoerp/settings/SettingsHelper.java:[62,20] org.jinq.orm.stream.JinqStream.org.jinq.orm.stream.JinqStream.Where in package org.jinq.orm.stream is not accessible
(package org.jinq.orm.stream is declared in the unnamed module, but module codebb.protoerp does not read it)

@my2iu
Copy link
Owner

my2iu commented Oct 14, 2020

What is your modules setup? And what is SettingsHelper doing with Jinq? Is it just using Jinq internally or is it exposing some of Jinq’s classes externally?

@georgemoralis
Copy link
Author

my pom.xml has

org.jinq jinq-jpa 1.8.31

my module class file has

requires jinq.jpa;

SettingsHelper is some help functions to update a table
For example this is how it is done for one function (works fine under java 8)

public static void updateStringSetting(String settingName, String settingValue) {
GenericDao gdaoi1 = new GenericDao(SettingsEntity.class, MainApp.getEmf());
JinqJPAStreamProvider streams = new JinqJPAStreamProvider(MainApp.getEmf());
EntityManager em = MainApp.getEmf().createEntityManager();
Optional result = streams
.streamAll(em, SettingsEntity.class)
.where(c -> c.getSettingName().equals(settingName))
.findFirst();
em.close();

    if (result.isPresent()) {
        SettingsEntity tmp3 = (SettingsEntity) result.get();
        tmp3.setSettingValue(settingValue);
        gdaoi1.updateEntity(tmp3);
    }

}

@my2iu
Copy link
Owner

my2iu commented Oct 14, 2020

JinqStream.Where is actually defined in org.jinq.api. Is it possible to reference that jar directly somehow in your module setup?

@georgemoralis
Copy link
Author

hmm it appears to compile if i add

requires api;

in module-info.java but i guess that is not a good name (can easily conflict)

@my2iu
Copy link
Owner

my2iu commented Oct 14, 2020

I was hoping to hold off on adding modularizing the codebase until the next JDK LTS release because it might break the old JDK8 support, and a bunch of extra workarounds might be needed. I might be able to just rename things inside Maven though.

Let me think about it for a bit.

@georgemoralis
Copy link
Author

i am writting an open src ERP using jinq btw.

It is still in early stages but you can check it

https://github.com/codebbgr/protoERP

@my2iu
Copy link
Owner

my2iu commented Oct 18, 2020

I looked at enabling modules in Jinq, and it works, but I'm not sure I'm happy with the result, so I'm going to leave full module support for the future. Instead, I'll just provide automatic module names to the .jars so that there will be no module name collisions.

The module names you will need will eventually be org.jinq.api and org.jinq.jpa.

I don't have easy access to my build machine at the moment, so I'll need to hold off making an actual release with these changes until later on, unless it's really urgent for you.

@georgemoralis
Copy link
Author

it is not that urgent , atm i don't have collisions so take your time ;)

@my2iu
Copy link
Owner

my2iu commented Nov 4, 2020

Ok, I've released version 1.8.32 to Maven. It provides the automatic module names org.jinq.api instead of api and org.jinq.jpa instead of jinq.jpa

@my2iu my2iu closed this as completed Nov 4, 2020
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

2 participants