-
Notifications
You must be signed in to change notification settings - Fork 11
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
Hibernate 5.4 extension updates #36
base: 5.4
Are you sure you want to change the base?
Hibernate 5.4 extension updates #36
Conversation
Useful for tests or simply acquiring the internal Hibernate transaction
1. Drop the old EVComponent and InterceptorImpl. We only need event handling in a single place (for now). 2. Rename variables, method names, and class properties to make it obvious when we're invoking an EventHandler method, and when we're invoking a method on a standard entity CFC. 3. More java docs 4. A basic unit test - ya know, for science.
Using `ant dist && ./test.sh`, we can easily build the extension to a .lex file and immediately run CFML tests against a specific version of Lucee.
These function definitions belong in the ORM extension. Copied verbatim from Lucee core.
@@ -0,0 +1,37 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,76 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,34 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,38 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,39 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,40 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what is going on here, but print and aprint are classes present in the lucee core and every extension, they are used to make printout while developing and should NOT be removed.
- print can be used like the dump function and can better show complex structures than System.out
- you can simply remove the "extends aprint" from the print class to see where the class is used, helpful to clean up
please do not simply remove stuff you don't completely understand the need for
@@ -0,0 +1,40 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,42 @@ | |||
/** | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,41 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,39 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,108 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,39 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,47 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,47 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,44 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment for EntityDelete
@@ -0,0 +1,1068 @@ | |||
package org.lucee.extension.orm.hibernate.util; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hard to see the change, when the function not got moved but deleted and created. did you just chnage the package name or also code inside the class. best do not move stuff around at all,this can be done is a separate "clean up PR".
In short move the class back to it's old package
@@ -0,0 +1,299 @@ | |||
package org.lucee.extension.orm.hibernate.util; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as CommonUtil i guess
@@ -1,432 +0,0 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert that change, add it again
source/tld/ormTags.tldx
Outdated
@@ -0,0 +1,21 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this tld has no use, why did you add it?
@@ -0,0 +1,28 @@ | |||
package org.lucee.extension.orm.hibernate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we make all our test cases on CFML level, for one simple reason. we wanna have the test as close to real world as possible, so no java based test cases, please remove
I have reviewed part of the PR, not everything because we have some issue repeating itself over and over again. "Noise problems" You have changed couple of package names of classes and not moved them. so they appear as new classes and the old one got deleted, so like with the functions it is unclear if you simply changed the package name or also modified the classes, best revert that change and do it in a separate clean up PR. Please do not remove code like print/aprint, that is used in every Lucee project and do not indroduce new stuff like junit that is not used in any Lucee project, let's just stick to the necessary changes with that PR. |
The
Besides these concerns, having ORM functionality encapsulated within the Lucee ORM extension makes practical and organizational sense. With that said, the Other feedback items:
Our only aim here is to improve the quality and maintenance overhead of the Hibernate extension. As long as the changes improve maintainability and do not adversely affect the CFML developer, I don't see why these changes should be backed out of the PR. |
Actually, this file is already committed and does point to the moved functions: extension-hibernate/source/fld/ormFunctions.fld Lines 15 to 29 in 934dddc
|
@michaeloffner I updated the built-ins ( Can we get another review on this? |
Hibernate 5.4 Extension Updates
Thanks to a client project, we (Ortus Solutions) have had the opportunity to assist with closing some of the open ORM / Hibernate extension issues, as well as bring the extension up to modern standards in a few areas. Notably, this PR:
Explanation of changes:
Bug Fixes
New Features
Initialization Rework
See commits 41f0d86, e8d0dd0, and e31782f
INIT_CFCS
andINIT_ALL
were mapped to the same int, so each page load would re-inspect all ORM entities.hasTempCFCs()
boolean method for clarity when looking for ORM entities in the list of pre-inspected entitiesThis refactor alone reduces the time to reinit 1,000 entities from ~14s to ~4s - a ~70% improvement!
See performance data collected via Hibernate Playground against the 3.5 extension, 5.4 extension, and 5.4 with modifications:
Documentation
Tests
this.ormSettings.ormConfig
XML file (c0fdc92)this.ormSettings.cacheconfig
XML file (2e1455e)datasource
annotation on individual entity components (6cac457)test.sh
for easily running Lucee test cases (c997777)Housekeeping
ORM*()
,entity*()
methods such asORMReload()
,entitySave()
to extension (e116049, c0879cd, 00681de).lucee
components (aa4aa49), (ac5abbf)*Util.java
classes to.util
package (24c4115)formatter-maven-plugin
(c43c60e, c4c3ad9, 65f44cf)GitHub Actions Secrets
The new javadocs CI build auto-uploads generated java documentation to S3 using the configured secrets.
You'll need to add these secrets to the Github Secrets admin:
AWS_APIDOCS_BUCKET
Bucket name to upload to - for example,apidocs.lucee.org
AWS_ACCESS_KEY
S3 access key IDAWS_ACCESS_SECRET
S3 access key secretIn addition, the maven java formatter requires read/write permissions in order to commit file changes to the repository. This can be accomplished using a
GH_TOKEN
secret containing a personal access token with read and write permissions to theextension-hibernate
repository.