From 8ab6f7031e2b52c7fb5ec71ebb6d20f85dc87318 Mon Sep 17 00:00:00 2001
From: Oliver Grande
Date: Tue, 24 Oct 2023 11:47:52 +0200
Subject: [PATCH] Feature/release 2.0.0 (#230)
* Feature/transient fields (#142)
* Fix null pointer if no enumerations are part of servcie
* Enable HAS and enumeration as return type of operations
* Allow Enumerations as operation parameter
* Provide java based operations converted enumeration
* Add SourceClear addon
* Delete SourceClean addon
* Enumerations at UDF functions
- Works for bound functions
- Works for functions with import
* Correct unit tests
* Enable multiple values for flags enumerations
* Switch detection default between Embedded and Entity type
* Allow collection attributes for metadata
* Enable query without collection attributes
* Rework query result conversion to reduce memory consumtion
* Missing Metadata pom
* First step entity with collections as return of function/action
* Bugfix: Expand on Parent with $filter on navigation path
* Enable the use of Join Tables
- Filter on navigation via Join Table generally not supported
* Create new query for inlinecount
* Enable Join Tables@Navigation Filter
- Not working mapped associations
- Not working $count
* Enable Join Tables@Navigation Filter
- With mapped associations
- With $count, know issue EclipsLink two sub types
* Increase Version --> 0.2.6
* Remove deprecated JPAExecutableQuery
* Bugfix: unidirectional join table based association
* Access collection properties via navigation
- New version
* Access collection properties w and w/o $select
* Access collection properties which are part of complex property
* CUD operations on collection properties
* Filter on collection properties pre optimization
* Filter on collection properties any/all
* Filter on collection w/o filter on $count and orderby $count
* Correct issue #29
- Correct /$count implementation in JPAJoinQuery
- Clean-up Hibernate differences
-- Subquery from clause
-- Id Class determination
* Increase Version to 0.2.7
* Enable ..@odata.navigationLink in case of odata.metadata=full
- links@complex types not yet working
* Preparation for solution of issue OLINGO-1143
* Correct NullPointer and some clean-ups
* Support order by $count
- Increase version to 0.2.8
* Intermediate merge clean-up
* Solve merge problem navigate complex collections
* Resolve merge conflict converter
* Correct error collection property and expand=*
* Enable filter $count on collection property
* Update version and url
* Create and use page provider
* Recreate change for solution of issue OLINGO-1143
* Finalize top level server driven paging
* Correct string handling error
* Correct link problem
* Enable skiptoken to have other type than String
* Move paging so next request injects old uriInfo correctly
* Enable deep insert via complex properties
* Ignore test for next commit
* Enable create of a new entity linked by a to one using PATCH
* Update to Olingo 4.5.0
- use new Olingo version
- adopt one test to changed @odata.context content
* Collection attributes rework. Issue #60
- Change processor pom -> javax.servlet became provided
* Enable annotation for properties to mark them authorization relevant
* Enable multiple protected properties at complex attributes
* Rework EdmProtectedBy annotation to handle multiple claims at complex
* Process protection
* Rework handling of ignored protected
* Made inner class static
* Fixing issue #60
* $count query not working correctly on complex collection attributes
* Various small bugs
- Reorg. pom.xml
- Correct http status on empty result
- Correct empty check for collection properties
* Correct typo in interface JPAODataPagingProvider
* Prepare JPAODataDatabaseTableFunction for paging
* Change to HSQLDB
* Remove function from sql-file to work around problems with Derby
* Correct NullPointerException EdmEntitySetResult
* Determine result of create dependent based on before image
* EntityType getAttribute did not return value for embedded id
* Provide CUD example and correct query status codes
* Correct query response
* Maven Archetype for Spring based service
* Upgrade to Junit5 to get support for Java > 1.8
* Extract interface for better unit test support
- Cleanup tests
* Clean-up interface implementation
* Add SQL function handling
* Complete DB function changes
* Clean-up test class
* Clean-up test class
* Update Version number
* Update Version number
* Additional test for API classes
* Enable suppress of wildcard in metadata
* Enable wildcards during query processing
* Increase information on error during filter
* Support of PUT on collection properties and primitive properties
* Fix Null Pointer on PATCH with return != minimal
* Claims where not respected by queries issue #69 part one
- /$count
- ?$count=true
- paging queries
* Claims where not respected by queries issue #69 part two
- $filter
- Update on Olingo 4.6.0
* Restrict the DISTINCT to protections only
* Increase test coverage
- New tests
- Rework vocabulary handling
* Cleanup Vocabularies II
- Add Action and Function
- Remove NavigationProperty and dependent
* Additional test and solution of issue #78
* Enable new annotation EdmVisibleFor at properties
* Introduction of Request Context
- Deprecation of two variants of JPAODataGetHandler.process
- Increase test coverage
* Restrict EdmVisiableFor to nullable non key attributes
* Skip properties from selection that do not belong to provided group
* Handle collection properties and navigation path
* Enable groups at complex collections
* Handle OrderBy clause
* Correct unit test
* Rework test containing images
* Rework context handling
- Move of cud handler to request context
- Move of DebugSupport to request context (is request specific because
of isUserAuthorized)
- Introduction of builder for Service Context to get a leaner creation
of handler
* Providing groups during modifying requests
* Re-enable old shortcut with late metadata provisioning
* Update pom for missing jackson dependency
* Update Archetype to version 0.3.4
* Update Version
* Extension of session context, so an emf can be provided
* Ignore annotation qualified if empty
* Go back to Olingo JSON deserializer
* Add qualifier to annotation
* Increase release
* Clean-up JPAEdmNameBuilder
* Preparation of custom name builder
- Create public interface
- replace class by new interface
* Revoke test adoption
* Providing custome name builder
* Update annotation EdmFunction
* Increase release
* Adopt archetype
- Simplify service
- Add integration test
* Modify example did not persist on create
* Deep Insert did not responded deep
* Always select ETag
* Complete ETag handling
* Missing Context Changes
* Reset unit test to current pushed state
* Increase test coverage
* Adopt test to real number of complex types
* Enable V4.01 JSON format as request and response
* Additional Integration tests support OData V4.01 JSON
* Allow usage of different types of transaction
* Increase Spring support
* Bugfix/issue83 (#120)
* Update Version
* Extension of session context, so an emf can be provided
* Preparation of custom name builder
- Create public interface
- replace class by new interface
* Revoke test adoption
* Providing custome name builder
* Update annotation EdmFunction
* Increase release
* Adopt archetype
- Simplify service
- Add integration test
* Modify example did not persist on create
* Deep Insert did not responded deep
* Always select ETag
* Complete ETag handling
* Missing Context Changes
* Reset unit test to current pushed state
* Increase test coverage
* Adopt test to real number of complex types
* Enable V4.01 JSON format as request and response
* Additional Integration tests support OData V4.01 JSON
* Allow usage of different types of transaction
* Increase Spring support
* Restrict $expand select by key range
* Support root with navigation like AdministrativeDivision(...)/Children
* Protect dilution of test coverage by test package (#133)
* Increase release
* Increase release (#136)
* Protect dilution of test coverage by test package (#135)
* Remove deprecated artifacts (#134)
* Remove deprecated artefacts
* Missing test adoptions
* Upgrade Olingo version and processor version
* Feature/transient fields (#137)
* Increase release
* Upgrade Olingo version and processor version
* Prevent NPE on expand empty result (#138)
* Correct SonarQube and SpotBug hints
* Feature/transient fields (#139)
* Increase release
* Upgrade Olingo version and processor version
* Correct SonarQube and SpotBug hints
* SpotBugs and clean-ups
* Build metadata I
* First draft of criteria builder and query implementation (#140)
* First draft of criteria builder and query implementation
* Add Transient
* First join version
* Correct structured type
* Test adoption was missing
* Update criteria builder
* Solve enum error
* Support aggregation function
* Correct buildInverseJoinColumns() error
* Add Test buildInverseJoinColumns() error
* Enable table join without entity type
* Correct Error table name
* Own test for JPAEdmProvider and correct name builder error
* Additional test
* Support parallel processing of batch requests
* Complete synchronized creation of metadata
* Enable transient field calculator
* Suppress transient fields at $filter and $orderby
* Enable transient collections and collections with transient attributes
* Additional tests for changing operations
* Enable absolute path in url
* Add sonar plugin (#144)
* Add sonar plugin
* Update pom with sonar plugin
* Feature/logging (#145)
* Add sonar plugin
* Update pom with sonar plugin
* Remove old xmake version
* Feature/logging (#147)
* Add sonar plugin
* Update pom with sonar plugin
* Remove old xmake version
* Logging as part of standard debugger
* Generic authorization check for JPAExampleCUDRequestHandler
* Feature/logging (#148)
* Add sonar plugin
* Update pom with sonar plugin
* Remove old xmake version
* Logging as part of standard debugger
* Generic authorization check for JPAExampleCUDRequestHandler
* Update xmake version
* Feature/logging (#150)
* Add sonar plugin
* Update pom with sonar plugin
* Remove old xmake version
* Logging as part of standard debugger
* Generic authorization check for JPAExampleCUDRequestHandler
* Update xmake version
* Clean-up sonar issues
* Feature/logging (#151)
* Add sonar plugin
* Update pom with sonar plugin
* Remove old xmake version
* Logging as part of standard debugger
* Generic authorization check for JPAExampleCUDRequestHandler
* Update xmake version
* Clean-up sonar issues
* Update build status on read.me
* New badges
* Update README.md
* Update README.md
* Feature/logging (#152)
* Add sonar plugin
* Update pom with sonar plugin
* Remove old xmake version
* Logging as part of standard debugger
* Generic authorization check for JPAExampleCUDRequestHandler
* Update xmake version
* Clean-up sonar issues
* Update build status on read.me
* New badges
* Clean-up sonar issues
* Create additional test for debugger
* Add tests for debugger
* Update README.md
* Replace database derby -> hsqldb
* Update README.md (#153)
* Feature/logging (#154)
* Add sonar plugin
* Update pom with sonar plugin
* Remove old xmake version
* Logging as part of standard debugger
* Generic authorization check for JPAExampleCUDRequestHandler
* Update xmake version
* Clean-up sonar issues
* Update build status on read.me
* New badges
* Clean-up sonar issues
* Create additional test for debugger
* Add tests for debugger
* Update README.md
* Replace database derby -> hsqldb
* Cleanup sonar issue
* Increase test coverage for criteria builder (#155)
* Feature/criteria builder (#156)
* Increase test coverage for criteria builder
* Replace double implementation by mocks
* Update README.md (#157)
* Feature/criteria builder (#158)
* Increase test coverage for criteria builder
* Replace double implementation by mocks
* Rework vocabulary read
* Feature/criteria builder (#159)
* Increase test coverage for criteria builder
* Replace double implementation by mocks
* Rework vocabulary read
* Add method to retrieve all claims
* Update README.md (#160)
* Update README.md
* Update README.md
* Remove potential null pointer (#161)
* Bugfix/sonar issues (#162)
* Remove potential null pointer
* Remove potential Null Pointer
* Bugfix/sonar issues (#163)
* Remove potential null pointer
* Remove potential Null Pointer
* Remove potential Null Pointer
* Bugfix/sonar issues (#164)
* Remove potential null pointer
* Remove potential Null Pointer
* Remove potential Null Pointer
* Additional clean-ups
* Work on soanr issues
* Bugfix/sonar issues (#165)
* Remove potential null pointer
* Remove potential Null Pointer
* Remove potential Null Pointer
* Additional clean-ups
* Work on soanr issues
* Additional cleanups
* Feature/release 1.0.0 (#170)
* Bugfix/typo package (#168)
* Update version to 1.0.0-RC
* Rename package to ...metadata.core.edm.mapper.extension
* Rename message constants
* Correct typos in method names
* Rollback change to Optional
* Support Include Annotation (#169)
* Feature/include annotation (#171)
* Support Include Annotation
* Increase test coverage transient properties
* Bugfix/issue98 (#173)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Bugfix/issue98 (#174)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* sonar issues (#175)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* Clean-up sonar issues
* Bugfix/issue98 (#176)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* Clean-up sonar issues
* Clean-up sonar issues
* Bugfix/issue98 (#177)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* Clean-up sonar issues
* Clean-up sonar issues
* Delete intermediate code
* Feature/criteria builder (#178)
* Increase test coverage for criteria builder
* Replace double implementation by mocks
* Rework vocabulary read
* Add method to retrieve all claims
* Add README.md and correct spelling errors
* Add README.md and correct spelling errors (#179)
* Feature/release 1.0.0 (#192)
* Bugfix/typo package (#168)
* Update version to 1.0.0-RC
* Rename package to ...metadata.core.edm.mapper.extension
* Rename message constants
* Correct typos in method names
* Rollback change to Optional
* Support Include Annotation (#169)
* Feature/include annotation (#171)
* Support Include Annotation
* Increase test coverage transient properties
* Bugfix/syntax errors (#181)
* Feature/release 1.0.0 (#170)
* Bugfix/typo package (#168)
* Update version to 1.0.0-RC
* Rename package to ...metadata.core.edm.mapper.extension
* Rename message constants
* Correct typos in method names
* Rollback change to Optional
* Support Include Annotation (#169)
* Feature/include annotation (#171)
* Support Include Annotation
* Increase test coverage transient properties
* Bugfix/issue98 (#173)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Bugfix/issue98 (#174)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* sonar issues (#175)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* Clean-up sonar issues
* Bugfix/issue98 (#176)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* Clean-up sonar issues
* Clean-up sonar issues
* Bugfix/issue98 (#177)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* Clean-up sonar issues
* Clean-up sonar issues
* Delete intermediate code
* Feature/criteria builder (#178)
* Increase test coverage for criteria builder
* Replace double implementation by mocks
* Rework vocabulary read
* Add method to retrieve all claims
* Add README.md and correct spelling errors
* Add README.md and correct spelling errors
* Correct syntax errors metadata
* Clean-up typos
* Rework build of OrderBy creation (#183)
* Bugfix/syntax errors (#185)
* Feature/release 1.0.0 (#170)
* Bugfix/typo package (#168)
* Update version to 1.0.0-RC
* Rename package to ...metadata.core.edm.mapper.extension
* Rename message constants
* Correct typos in method names
* Rollback change to Optional
* Support Include Annotation (#169)
* Feature/include annotation (#171)
* Support Include Annotation
* Increase test coverage transient properties
* Bugfix/issue98 (#173)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Bugfix/issue98 (#174)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* sonar issues (#175)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* Clean-up sonar issues
* Bugfix/issue98 (#176)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* Clean-up sonar issues
* Clean-up sonar issues
* Bugfix/issue98 (#177)
* Support java.time.Instant and BigInteger
* Correct issue #98
- Correct typo
- Make DatabaseProcessor public
* Enhance documentation of transient property calculator
* Clean-up sonar issue
* Clean-up sonar
* Clean-up author
* Meaningfull error message on $apply
* Service Context creates Emf Wrapper if present in class path
* Suppoprt of MappedSuperclass
* $top and $skip use order by primary key
* Clean-up sonar issues
* Clean-up sonar issues
* Delete intermediate code
* Feature/criteria builder (#178)
* Increase test coverage for criteria builder
* Replace double implementation by mocks
* Rework vocabulary read
* Add method to retrieve all claims
* Add README.md and correct spelling errors
* Add README.md and correct spelling errors
* Add README.md and correct spelling errors (#179)
* Correct syntax errors metadata
* Clean-up typos
* Update Version -> 1.0.0
* Usage of builder to create external request context (#187)
* Bugfix/continue on error (#189)
* Move batch processor from API to PROCESSOR package
* Correct continue-on-error handling
* Support generated Id in example CUD handler (#190)
* Support generated Id in example CUD handler
* Correct failing test
* Adoption of archetype to 1.0.0 (#191)
* Adoption of archetype to 1.0.0
* Correct sql error
* Clean-up sonar issues
* Correct criteria builder implementation (#193)
* Feature/criteria builder (#194)
* Correct criteria builder implementation
* Enable sub query as FROM
* Update tests
* Update sonar issues
* Update sonar issue
* Add mutation testing to processor and metadata
* Feature/criteria builder (#195)
* Correct criteria builder implementation
* Enable sub query as FROM
* Update tests
* Update sonar issues
* Update sonar issue
* Add mutation testing to processor and metadata
* Eliminate duplicate code
* Feature/criteria builder (#196)
* Correct criteria builder implementation
* Enable sub query as FROM
* Update tests
* Update sonar issues
* Update sonar issue
* Add mutation testing to processor and metadata
* Eliminate duplicate code
* Add Locale to request context, so it can be set from user data
* Correct request context copy
* Feature/criteria builder (#197)
* Correct criteria builder implementation
* Enable sub query as FROM
* Update tests
* Update sonar issues
* Update sonar issue
* Add mutation testing to processor and metadata
* Eliminate duplicate code
* Add Locale to request context, so it can be set from user data
* Correct request context copy
* Missing transient fields at $expand
* Add tests
* Feature/criteria builder (#198)
* Correct criteria builder implementation
* Enable sub query as FROM
* Update tests
* Update sonar issues
* Update sonar issue
* Add mutation testing to processor and metadata
* Eliminate duplicate code
* Add Locale to request context, so it can be set from user data
* Correct request context copy
* Missing transient fields at $expand
* Add tests
* Fix GeneratedKey problem
* Feature/criteria builder (#199)
* Correct criteria builder implementation
* Enable sub query as FROM
* Update tests
* Update sonar issues
* Update sonar issue
* Add mutation testing to processor and metadata
* Eliminate duplicate code
* Add Locale to request context, so it can be set from user data
* Correct request context copy
* Missing transient fields at $expand
* Add tests
* Fix GeneratedKey problem
* Intermediate state
* Enable next block of queries
* Expand with Join Tables
* Last unit test corrections
* Eliminate typos
* Finalize changes
* missing variable usage (#200)
* missing variable usage
* Increase processor version
* Clean-up Sonar issues (#201)
* Bugfix/no mapper for operations (#202)
* Clean-up Sonar issues
* Add test for type mapping for actions and java function
+ Cleanup test classes
* Feature/1.0.1 (#203)
* Correct criteria builder implementation
* Enable sub query as FROM
* Update tests
* Update sonar issues
* Update sonar issue
* Add mutation testing to processor and metadata
* Eliminate duplicate code
* Add Locale to request context, so it can be set from user data
* Correct request context copy
* Missing transient fields at $expand
* Add tests
* Fix GeneratedKey problem
* Change version to 1.0.1
* New version (#204)
* Bugfix/filter eq withdate (#205)
* New version
* Support filter on Date and DateTime
* Correct precision
* Change another test
* Us generated alias for column selection (#206)
* Upgrade Version (#207)
* Us generated alias for column selection
* Upgrade version
* Reduce complexity (#209)
* ALL did not work with functions like startswith (#210)
* Update version (#208)
* Entity Set Path @ DB Functions (#211)
* Feature/new archetype (#212)
* Clean-up folder name
* Create archetype repo
* Use copy of spring archetype as start
* Enable named queries
* Feature/new archetype (#213)
* Clean-up folder name
* Create archetype repo
* Use copy of spring archetype as start
* Enable named queries
* Allow Star for non string claim properties
* Add Equals method to DeepProtectedExample
* Feature/new archetype (#214)
* Clean-up folder name
* Create archetype repo
* Use copy of spring archetype as start
* Enable named queries
* Allow Star for non string claim properties
* Add Equals method to DeepProtectedExample
* Enable grant access to all for non string fields read
* Replace Reflections API by Reflections8 (#215)
* Support entitytypes singeltons (#216)
* New annotation to make singletons and entity types
- Update to olingo 4.8.0
- Deprecate EdmAsEntitySet
- Read not ready
* Update README.md (#218)
* Update README.md
* Update README.md
* Update README.md
* Solve issue 136 (#217)
* Solve issue 136
* Eliminate hyphen
* Eliminate WhiteSource detected vulnerabilities (#219)
* Eliminate WhiteSource detected vulnerabilities
* Add now required dependency
* Remove setExternalName from Metadata Post Processor (#220)
* Support entitytypes singeltons (#221)
* New annotation to make singletons and entity types
- Update to olingo 4.8.0
- Deprecate EdmAsEntitySet
* Wrong entity type on singleton only
* Add java doc to TopLevelElementRepresentation
* Finalize singleton metadata handling
* Clean-up test classes
* Add option to retrieve Singleton from SD
* Rename test class
* Support entitytypes singeltons (#222)
* New annotation to make singletons and entity types
- Update to olingo 4.8.0
- Deprecate EdmAsEntitySet
* Wrong entity type on singleton only
* Add java doc to TopLevelElementRepresentation
* Finalize singleton metadata handling
* Clean-up test classes
* Add option to retrieve Singleton from SD
* Rename test class
* Add and clean-up unit tests
* Query extension declaration (#223)
* New annotation to make singletons and entity types
- Update to olingo 4.8.0
- Deprecate EdmAsEntitySet
* Wrong entity type on singleton only
* Add java doc to TopLevelElementRepresentation
* Finalize singleton metadata handling
* Clean-up test classes
* Add option to retrieve Singleton from SD
* Rename test class
* Add and clean-up unit tests
* Introduce query extension metadata
* Enable Singleton and Cast on subtypes
- clean-up sonar issues
* Support entity types and singletons (#224)
* New annotation to make singletons and entity types
- Update to olingo 4.8.0
- Deprecate EdmAsEntitySet
* Wrong entity type on singleton only
* Add java doc to TopLevelElementRepresentation
* Finalize singleton metadata handling
* Clean-up test classes
* Add option to retrieve Singleton from SD
* Rename test class
* Add and clean-up unit tests
* Introduce query extension metadata
* Enable Singleton and Cast on subtypes
- clean-up sonar issues
* Clean-up sonar issues
* Support cast on navigations (#225)
* New annotation to make singletons and entity types
- Update to olingo 4.8.0
- Deprecate EdmAsEntitySet
* Wrong entity type on singleton only
* Add java doc to TopLevelElementRepresentation
* Finalize singleton metadata handling
* Clean-up test classes
* Add option to retrieve Singleton from SD
* Rename test class
* Add and clean-up unit tests
* Introduce query extension metadata
* Enable Singleton and Cast on subtypes
- clean-up sonar issues
* Clean-up sonar issues
* Cast within navigation path
* Add cast collections
* Add tests for EdmBoundCast
* Support Cast on $expand
* Update README.md (#226)
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Bugfix/no constranis with ignored properties (#227)
* Suppress referential constraint for properties that shall be ignored
* No Referential Constraint in case one property shall be ignored
* Bugfix/no constranis with ignored properties (#228)
* Suppress referential constraint for properties that shall be ignored
* No Referential Constraint in case one property shall be ignored
* Bring back error on ignored
* Enable subtyping for complex types (#229)
* Support transient properties that require ignored properties (#231)
* Bugfix/multi level inheritance (#232)
* Adopt process-cb
* Correct type converter problem
* Use dbType for tuple result mapping
* Bugfix/multi level inheritance (#233)
* Adopt process-cb
* Correct type converter problem
* Use dbType for tuple result mapping
* Correct constructor test of extension
* Feature/release 1.0.3 (#234)
* Correct typos and replace deprecated method
* Set final Version
* Feature/release 1.0.4 (#235)
* Error corrections
- Debugger did not work
- Transaction Factory not forwarded
* Update release
* Make debugger runtime a List
* Feature/release 1.0.4 (#236)
* Error corrections
- Debugger did not work
- Transaction Factory not forwarded
* Update release
* Make debugger runtime a List
* Small adoptions to test model
* Reset change
* Error correction (#237)
* Feature/release 1.0.5 (#238)
* Error corrections
- Debugger did not work
- Transaction Factory not forwarded
* Update release
* Make debugger runtime a List
* Small adoptions to test model
* Reset change
* Add test for criteria builder
* Error correction
* Update H2 version (#239)
* Update H2 version
* Update version and rework DataSourceHelper
* Feature/release 1.0.6 (#240)
* Update H2 version
* Update version and rework DataSourceHelper
* Let H2 run in Postges mode
* Upgrade version and additional tests (#241)
* Upgrade version and additional tests
* Remove session context from queries
* Remove session context from processors
* New version an sonar clean-up (#242)
* Release 1.1.0 (#243)
* New version an sonar clean-up
* New path property fro sonar
* Release 1.1.0 (#244)
* New version an sonar clean-up
* New path property fro sonar
* Test usage of SNAPSHOT version
* Update version -> 1.0.8 (#245)
* Update version -> 1.0.8
* Count queries support Integer as result
* Update archetype to support PATCH
* Feature/release 1.0.0 (#247)
* New version an sonar clean-up
* New path property fro sonar
* Test usage of SNAPSHOT version
* Adopt archetype
* Clean-up sonar issues
* Resolve more sonar issues
* Introducing virtual property
* Clean-up associations and enable default columns when using ...-cb
* Generate metadata for overloaded action (#248)
* Generate metadata for overloaded action
* Process action
* Feature/action overload (#249)
* Generate metadata for overloaded action
* Process action
* Use constructor of entity type an action is called for not of binding
* Fix claims in collections where (#250)
* Fix claims in collections where
* Missed interface definition
* Missed test renaming
* Use dbtype to build key pair in case a conversion exists (#251)
* Enable more constructors for binding parameter (#252)
* Feature/more flexable constructor determination operations (#253)
* Enable more constructors for binding parameter
* Clean-up sonar errors
* New type cast added - they have possible data lost (#254)
* Collection not longer retrieves transient (#255)
* Collection not longer retrieves transient
* Skip unit test
* Enhance partner determination (#256)
* Bugfix/reuse navigation as partner (#257)
* Enhance partner determination
* Remove one sonar issue
* Bugfix/reuse navigation as partner (#258)
* Enhance partner determination
* Remove one sonar issue
* Correct partner determination
* No fallback to server locale in case bundle requested local not found (#259)
* Replace file reader (#260)
* Replace fixed values by variables (#261)
* Bugfix/error in controller test (#262)
* Replace fixed values by variables
* Update pom
* Update archetype pom (#265)
* Defect/archetype pom (#266)
* Update archetype pom
* Check older version of sonar plugin
* Update test constants (#267)
* Correct count behavior (#268)
* Change to Java 11 (#269)
* Change to Java 11
* Revert Java 11
* Update README.md (#270)
* Defect/count not working on hana (#271)
* Correct count behavior
* Ignore sonar check. Equal methods are generated
* Defect/java function parameter name (#272)
* Raise meaningful exception on empty function parameter name
* Meaningful exception if action parameter name empty
* Raise message in case of Void as return type for functions (#273)
* Raise message in case of Void as return type for functions
* Add extenstion
* Error in if clause
* Extension of visitor for java functions (#274)
* Update version to 1.1.1 (#275)
* Feature/predefined annotations (#276)
* First list of predefined OData annotations
* Update capabilities annotations
* Sonar issues
* Update dependencies
* Adopt layer test
* Add page to order by builder (#277)
* Feature/predefined annotations (#278)
* First list of predefined OData annotations
* Update capabilities annotations
* Sonar issues
* Update dependencies
* Adopt layer test
* Intermediate state
* Clean-up basic mapping and introduce annotation
* Finalize annotation mapper
* Feature/predefined annotations (#279)
* First list of predefined OData annotations
* Update capabilities annotations
* Sonar issues
* Update dependencies
* Adopt layer test
* Intermediate state
* Clean-up basic mapping and introduce annotation
* Finalize annotation mapper
* Update dependency
* Feature/predefined annotations (#280)
* First list of predefined OData annotations
* Update capabilities annotations
* Sonar issues
* Update dependencies
* Adopt layer test
* Intermediate state
* Clean-up basic mapping and introduce annotation
* Finalize annotation mapper
* Update dependency
* Adopt HSQLDB
* Update .xmake.cfg (#283)
* Update .xmake.cfg
* Update .xmake.cfg
* Correct spelling (#281)
* Feature/predefined annotations (#282)
* First list of predefined OData annotations
* Update capabilities annotations
* Sonar issues
* Update dependencies
* Adopt layer test
* Intermediate state
* Clean-up basic mapping and introduce annotation
* Finalize annotation mapper
* Update dependency
* Adopt HSQLDB
* Rename package for vocabulary parser
* Move OData vocabularies to new module
* Merge tests
* Annotations in metadata
* Finalize annotations within metadata
* Update .xmake.cfg (#284)
* Update .xmake.cfg
* Update .xmake.cfg
* Feature/predefined annotations (#286)
* First list of predefined OData annotations
* Update capabilities annotations
* Sonar issues
* Update dependencies
* Adopt layer test
* Intermediate state
* Clean-up basic mapping and introduce annotation
* Finalize annotation mapper
* Update dependency
* Adopt HSQLDB
* Rename package for vocabulary parser
* Move OData vocabularies to new module
* Merge tests
* Annotations in metadata
* Finalize annotations within metadata
* Support sorting restrictions by annotation
* Build annotation based expand check
* Expand star via path reads only requested from database
* Check countability
* Support collection property count
* Annotations@Singeltons
* Provide AnnotationProvider to all model elements
* Enable annotations at properties
* Feature/predefined annotations (#287)
* First list of predefined OData annotations
* Update capabilities annotations
* Sonar issues
* Update dependencies
* Adopt layer test
* Intermediate state
* Clean-up basic mapping and introduce annotation
* Finalize annotation mapper
* Update dependency
* Adopt HSQLDB
* Rename package for vocabulary parser
* Move OData vocabularies to new module
* Merge tests
* Annotations in metadata
* Finalize annotations within metadata
* Support sorting restrictions by annotation
* Build annotation based expand check
* Expand star via path reads only requested from database
* Check countability
* Support collection property count
* Annotations@Singeltons
* Provide AnnotationProvider to all model elements
* Enable annotations at properties
* Enable access to annotations via JPARequestEntity
* Watch filtering
* Clean-up pom and typo correction (#288)
* Solve issue 212 and fix permission check issue with join tables (#289)
* Solve issue 212 and fix permission check issue with join tables
* $count for collection join as well
* Clean-up code
* Fix issue, converting type (#290)
* Fix issue, converting type
* Fix unit test
* Correct type determination
* Multi step Mapped Superclass (#291)
* Upgrade H2 to 2.2.220 (#293)
* Correct navigation to one is null (#294)
* Fix join column determination with cyclic dependency (#295)
* Fix join column determination with cyclic dependency
* Additional test for navigation with mapped join table
* Make OneToOne required and handle non JPA Processor errors in metadata (#296)
* Defect/issue214 (#297)
* Make OneToOne required and handle non JPA Processor errors in metadata
* Clean-up warnings
* Defect/issue214 (#298)
* Make OneToOne required and handle non JPA Processor errors in metadata
* Clean-up warnings
* Add check for OneToMany
* Clean-up sonar issues
* Update .xmake.cfg (#300)
* Update version to 2.0.0 (#299)
* Update version to 2.0.0
* Unify junit version
* Make use of Jakarta
* Clean-up sonar issues created by switching to Java 17
* Update dependencies
* Update dependencies and clean-up typos
* Add unit tests
* Increase test coverage
* Additional correction
* Update github workflow
* Correct parent pom
* Sonar and missed merge-conflicts
* Jakarta also in java doc
* Update archetype controller
* Support of Java 21
* Find archetype test error
* Remove import for LocalServerPort
* Remove flyway dependency and use spring boot provided
* Adopt EclipseLinkJpaConfiguration to Spring Boot 3.x
* Add missing imports
* Set package name
* Bring back flyway to artifact pom
* Update README
* Update README.md
* JPAEdmMetadataPostProcessor as interface
* Update README
* Fix sonar issue
* Fix another issue
---
.github/workflows/archetype.yml | 4 +-
LICENSE.txt | 2 +-
README.md | 42 +-
additionalWords.directory | 11 +-
.../odata-jpa-archetype-spring-scp/pom.xml | 34 -
.../META-INF/maven/archetype-metadata.xml | 50 -
.../resources/archetype-resources/pom.xml | 133 --
.../security/xs-security.json | 69 -
.../src/main/java/SpringApp.java | 12 -
.../config/EclipseLinkJpaConfiguration.java | 75 -
.../java/config/ProcessorConfiguration.java | 47 -
.../main/java/controller/ODataController.java | 33 -
.../src/main/java/model/EntityTemplate.java | 75 -
.../main/java/model/ValueObjectTemplate.java | 63 -
.../java/model/ValueObjectTemplateKey.java | 56 -
.../src/main/resources/application-test.yml | 23 -
.../src/main/resources/application.yml | 29 -
.../main/resources/db/migration/V1_0__jpa.sql | 14 -
.../src/test/java/AppTest.java | 20 -
.../java/integrationtest/ControllerTest.java | 158 --
.../requests/CreateEntityViaBatch.txt | 46 -
.../odata-jpa-archetype-spring/pom.xml | 7 +-
.../resources/archetype-resources/pom.xml | 60 +-
.../config/EclipseLinkJpaConfiguration.java | 27 +-
.../java/config/ProcessorConfiguration.java | 2 +-
.../main/java/controller/ODataController.java | 4 +-
.../src/main/java/model/EntityTemplate.java | 20 +-
.../main/java/model/ValueObjectTemplate.java | 16 +-
.../java/model/ValueObjectTemplateKey.java | 2 +-
.../src/main/resources/application-test.yml | 2 +-
.../java/integrationtest/ControllerTest.java | 3 -
jpa-archetype/pom.xml | 7 +-
jpa-tutorial/QuickStart/QuickStart.adoc | 26 +-
jpa/.settings/org.eclipse.jdt.core.prefs | 2 -
jpa/odata-jpa-annotation/.gitignore | 3 -
.../.settings/org.eclipse.jdt.core.prefs | 6 +-
....eclipse.wst.common.project.facet.core.xml | 2 +-
jpa/odata-jpa-annotation/pom.xml | 12 +-
.../converter/OffsetDateTimeConverter.java | 4 +-
.../converter/TimeInstantLongConverter.java | 4 +-
.../core/edm/annotation/EdmAsEntitySet.java | 21 -
.../core/edm/annotation/EdmEntityType.java | 4 +-
.../core/edm/annotation/EdmEnumeration.java | 7 +-
.../annotation/EdmQueryExtensionProvider.java | 13 +-
.../core/edm/annotation/EdmTransient.java | 6 +-
.../EdmTransientPropertyCalculator.java | 17 +-
.../edm/annotation/EdmEnumerationTest.java | 6 +-
.../EdmTransientPropertyCalculatorTest.java | 6 +-
jpa/odata-jpa-coverage/pom.xml | 4 +-
.../.settings/org.eclipse.jdt.core.prefs | 6 +-
....eclipse.wst.common.project.facet.core.xml | 2 +-
jpa/odata-jpa-metadata/pom.xml | 6 +-
.../api/JPAEdmMetadataPostProcessor.java | 19 +-
.../jpa/metadata/api/JPAEdmProvider.java | 5 +-
.../metadata/api/JPAEntityManagerFactory.java | 9 +-
.../jpa/metadata/api/JPAJoinColumn.java | 2 +-
.../metadata/api/JPAODataQueryContext.java | 6 +-
.../core/edm/mapper/api/JPAAttribute.java | 3 +-
.../edm/mapper/api/JPAEdmNameBuilder.java | 22 +-
.../edm/mapper/extension/ODataAction.java | 2 +-
.../edm/mapper/extension/ODataFunction.java | 2 +-
.../mapper/impl/DefaultEdmPostProcessor.java | 2 +-
.../impl/IntermediateActionFactory.java | 4 +-
.../impl/IntermediateCollectionProperty.java | 23 +-
.../mapper/impl/IntermediateComplexType.java | 4 +-
.../impl/IntermediateDescriptionProperty.java | 30 +-
.../impl/IntermediateEmbeddedIdProperty.java | 4 +-
.../mapper/impl/IntermediateEntityType.java | 60 +-
.../impl/IntermediateEnumerationType.java | 4 +-
.../impl/IntermediateFunctionFactory.java | 8 +-
.../mapper/impl/IntermediateJoinColumn.java | 2 +-
.../mapper/impl/IntermediateJoinTable.java | 11 +-
.../mapper/impl/IntermediateModelElement.java | 4 +-
.../impl/IntermediateNavigationProperty.java | 1419 +++++++++--------
.../impl/IntermediateOperationFactory.java | 15 +-
.../impl/IntermediateOperationHelper.java | 9 +-
.../edm/mapper/impl/IntermediateProperty.java | 25 +-
.../edm/mapper/impl/IntermediateSchema.java | 11 +-
.../impl/IntermediateServiceDocument.java | 3 +-
.../impl/IntermediateSimpleProperty.java | 12 +-
.../impl/IntermediateStructuredType.java | 62 +-
.../impl/IntermediateVirtualProperty.java | 3 +-
.../mapper/impl/JPAAssociationPathImpl.java | 12 +-
.../mapper/impl/JPADefaultEdmNameBuilder.java | 36 +-
.../core/edm/mapper/impl/JPANameBuilder.java | 2 +-
.../core/edm/mapper/impl/JPAPathImpl.java | 5 +-
.../impl/JPAServiceDocumentFactory.java | 4 +-
.../edm/mapper/impl/JPATypeConverter.java | 10 +-
.../reuse/OffsetDateTimeConverter.java | 27 -
.../metadata-exceptions-i18n.properties | 3 +-
.../jpa/metadata/api/JPAEdmProviderTest.java | 5 +-
.../edm/mapper/impl/CustomJPANameBuilder.java | 8 +-
.../impl/IntermediateActionFactoryTest.java | 6 +-
.../IntermediateCollectionPropertyTest.java | 12 +-
.../impl/IntermediateComplexTypeTest.java | 4 +-
.../impl/IntermediateContainerTest.java | 4 +-
.../IntermediateDescriptionPropertyTest.java | 10 +-
.../IntermediateEmbeddedIdPropertyTest.java | 4 +-
.../impl/IntermediateEntitySetTest.java | 6 +-
.../impl/IntermediateEntityTypeTest.java | 28 +-
.../impl/IntermediateJoinTableTest.java | 6 +-
.../IntermediateNavigationPropertyTest.java | 12 +-
.../impl/IntermediateOperationHelperTest.java | 32 +
.../impl/IntermediateReferencesTest.java | 2 +-
.../mapper/impl/IntermediateSchemaTest.java | 4 +-
.../impl/IntermediateSimplePropertyTest.java | 14 +-
.../impl/IntermediateSingletonTest.java | 4 +-
...turedTypeTransientPluralAttributeTest.java | 4 +-
...ateStructuredTypeVirtualAttributeTest.java | 4 +-
.../impl/IntermediateVirtualPropertyTest.java | 4 +-
.../impl/IntermediateWrongAnnotationTest.java | 8 +-
.../impl/JPAQueryExtensionProviderTest.java | 6 +-
.../edm/mapper/impl/JPATypeConverterTest.java | 8 +-
.../core/edm/mapper/impl/TestHelper.java | 14 +-
.../core/edm/mapper/impl/TestMappingRoot.java | 4 +-
.../mapper/testaction/ActionWithOverload.java | 8 +-
.../core/edm/mapper/testaction/Actions.java | 10 +-
.../ConverterWithConstructorError.java | 2 +-
.../testobjects/ExampleFunctionForFilter.java | 4 +-
.../testobjects/ExampleJavaEmConstructor.java | 10 +-
.../ExampleJavaPrivateConstructor.java | 10 +-
.../ExampleJavaTwoParameterConstructor.java | 10 +-
.../testobjects/FileAccessConverter.java | 8 +-
.../testobjects/TestActionCollection.java | 7 +
.../testobjects/TestCollectionInterface.java | 8 +
.../testobjects/WrongFunctionConstructor.java | 2 +-
.../testobjects/WrongMemberConverter.java | 8 +-
.../testobjects/WrongTypeConverter.java | 6 +-
jpa/odata-jpa-odata-vocabularies/pom.xml | 8 +-
.../JavaBasedODataAnnotationsProvider.java | 12 +-
jpa/odata-jpa-processor-cb/README.md | 2 +-
jpa/odata-jpa-processor-cb/pom.xml | 4 +-
.../cb/api/EntityManagerFactoryWrapper.java | 26 +-
.../processor/cb/impl/AbstractJoinImp.java | 11 +-
.../processor/cb/impl/CollectionJoinImpl.java | 27 +-
.../cb/impl/CompoundSelectionImpl.java | 65 +-
.../cb/impl/CriteriaBuilderImpl.java | 104 +-
.../processor/cb/impl/CriteriaQueryImpl.java | 37 +-
.../cb/impl/EntityManagerWrapper.java | 62 +-
.../jpa/processor/cb/impl/ExpressionImpl.java | 34 +-
.../jpa/processor/cb/impl/FromImpl.java | 131 +-
.../processor/cb/impl/InheritanceInfo.java | 9 +-
.../cb/impl/JPAAttributeWrapper.java | 10 +-
.../jpa/processor/cb/impl/JPAPathWrapper.java | 2 +-
.../jpa/processor/cb/impl/JoinTableJoin.java | 9 +-
.../jpa/processor/cb/impl/OrderImpl.java | 4 +-
.../processor/cb/impl/ParameterBuffer.java | 7 +-
.../jpa/processor/cb/impl/PathImpl.java | 40 +-
.../jpa/processor/cb/impl/PathJoin.java | 9 +-
.../jpa/processor/cb/impl/PredicateImpl.java | 17 +-
.../jpa/processor/cb/impl/RootImpl.java | 10 +-
.../jpa/processor/cb/impl/SelectionImpl.java | 5 +-
.../jpa/processor/cb/impl/SelectionPath.java | 29 +-
.../jpa/processor/cb/impl/SimpleJoin.java | 9 +-
.../jpa/processor/cb/impl/SqlJoinType.java | 2 +-
.../jpa/processor/cb/impl/SqlSelection.java | 2 +-
.../jpa/processor/cb/impl/SubqueryImpl.java | 35 +-
.../processor/cb/impl/SubqueryRootImpl.java | 39 +-
.../jpa/processor/cb/impl/TupleImpl.java | 14 +-
.../jpa/processor/cb/impl/TypeConverter.java | 16 +-
.../jpa/processor/cb/impl/TypedQueryImpl.java | 129 +-
.../cb/joiner/ExpressionCollector.java | 7 +-
.../processor/cb/joiner/ExpressionJoiner.java | 7 +-
.../cb/joiner/StringBuilderCollector.java | 7 +-
.../api/EntityManagerFactoryWrapperTest.java | 18 +-
.../cb/impl/AggregationExpressionTest.java | 6 +-
.../cb/impl/ArithmeticExpressionTest.java | 4 +-
.../processor/cb/impl/BuilderBaseTest.java | 29 +-
.../cb/impl/CompoundSelectionImplTest.java | 4 +-
.../cb/impl/CriteriaBuilderDerbyTest.java | 3 +-
.../cb/impl/CriteriaBuilderH2Test.java | 11 +-
.../cb/impl/CriteriaBuilderHSQLDBTest.java | 3 +-
.../cb/impl/CriteriaBuilderImplTest.java | 414 ++---
.../cb/impl/CriteriaBuilderOverallTest.java | 20 +-
.../cb/impl/CriteriaQueryImplTest.java | 32 +-
.../cb/impl/EntityManagerWrapperTest.java | 29 +-
.../processor/cb/impl/ExpressionImplTest.java | 4 +-
.../processor/cb/impl/ExpressionPathTest.java | 6 +-
.../jpa/processor/cb/impl/FromImplTest.java | 29 +-
.../cb/impl/InheritanceInfoTest.java | 2 +-
.../cb/impl/JPAAttributeWrapperTest.java | 2 +-
.../processor/cb/impl/JPAPathWrapperTest.java | 2 +-
.../processor/cb/impl/JoinTableJoinTest.java | 4 +-
.../jpa/processor/cb/impl/OrderImplTest.java | 4 +-
.../cb/impl/ParameterExpressionImplTest.java | 4 +-
.../jpa/processor/cb/impl/PathImplTest.java | 12 +-
.../processor/cb/impl/PrerdicateImplTest.java | 18 +-
.../jpa/processor/cb/impl/SimpleJoinTest.java | 4 +-
.../processor/cb/impl/SqlJoinTypeTest.java | 2 +-
.../processor/cb/impl/SubqueryImplTest.java | 39 +-
.../cb/impl/SubqueryRootImplTest.java | 55 +
.../jpa/processor/cb/impl/TupleImplTest.java | 6 +-
.../processor/cb/impl/TypedQueryImplTest.java | 16 +-
.../cb/joiner/ExpressionJoinerTest.java | 16 +-
.../processor/cb/testobjects/SubJoined.java | 4 +-
.../processor/cb/testobjects/SuperJoined.java | 8 +-
.../cb/testobjects/SuperTablePerClass.java | 8 +-
jpa/odata-jpa-processor-ext/pom.xml | 2 +-
.../cb/ProcessorCriteriaBuilder.java | 15 +-
.../processor/cb/ProcessorCriteriaQuery.java | 6 +-
.../jpa/processor/cb/ProcessorSelection.java | 24 +-
.../jpa/processor/cb/ProcessorSubquery.java | 11 +-
jpa/odata-jpa-processor-parallel/README.md | 8 +-
jpa/odata-jpa-processor-parallel/pom.xml | 90 +-
.../JPAODataBatchParallelRequestGroup.java | 7 +-
.../JPAODataBatchSequentialRequestGroup.java | 3 +-
.../JPAODataParallelBatchProcessor.java | 14 +-
...ParallelBatchProcessorIntegrationTest.java | 3 +-
.../JPAODataParallelBatchProcessorTest.java | 4 +-
.../test/util/IntegrationTestHelper.java | 30 +-
.../test/util/JakartaRequestMapper.java | 380 +++++
.../test/util/JakartaResponseMapper.java | 200 +++
.../test/util/JakartaServletInputStream.java | 24 +
.../test/util/JakartaServletOutputStream.java | 24 +
.../.settings/org.eclipse.jdt.core.prefs | 6 +-
....eclipse.wst.common.project.facet.core.xml | 2 +-
jpa/odata-jpa-processor/pom.xml | 26 +-
.../api/JPAAbstractCUDRequestHandler.java | 2 +-
.../core/api/JPACUDRequestHandler.java | 5 +-
.../core/api/JPAODataBatchProcessor.java | 8 +-
.../JPAODataDefaultTransactionFactory.java | 7 +-
.../api/JPAODataExternalRequestContext.java | 3 +-
.../jpa/processor/core/api/JPAODataPage.java | 31 +-
.../core/api/JPAODataPagingProvider.java | 4 +-
.../core/api/JPAODataRequestContext.java | 2 +-
.../api/JPAODataRequestContextAccess.java | 3 +-
.../core/api/JPAODataRequestHandler.java | 15 +-
.../core/api/JPAODataRequestProcessor.java | 20 +-
.../core/api/JPAODataServiceContext.java | 7 +-
.../api/JPAODataSessionContextAccess.java | 2 +-
.../core/api/JPAODataTransactionFactory.java | 23 +-
.../example/JPAExampleCUDRequestHandler.java | 22 +-
.../api/example/JPAExamplePagingProvider.java | 20 +-
.../core/api/mapper/JakartaRequestMapper.java | 395 +++++
.../api/mapper/JakartaResponseMapper.java | 211 +++
.../api/mapper/JakartaServletInputStream.java | 24 +
.../mapper/JakartaServletOutputStream.java | 24 +
.../core/converter/JPAExpandResult.java | 3 +-
.../JPAStructuredResultConverter.java | 2 +-
.../processor/core/converter/JPATuple.java | 22 +-
.../converter/JPATupleChildConverter.java | 22 +-
.../JPATupleCollectionConverter.java | 6 +-
.../converter/JPATupleResultConverter.java | 7 +-
.../JPAAbstractDatabaseProcessor.java | 4 +-
.../database/JPADefaultDatabaseProcessor.java | 12 +-
.../database/JPAODataDatabaseOperations.java | 4 +-
.../core/database/JPAODataDatabaseSearch.java | 14 +-
.../JPAODataDatabaseTableFunction.java | 2 +-
.../database/JPA_DERBY_DatabaseProcessor.java | 10 +-
.../JPA_HSQLDB_DatabaseProcessor.java | 10 +-
.../JPA_POSTSQL_DatabaseProcessor.java | 12 +-
.../exception/ODataJPAQueryException.java | 1 +
.../filter/JPAAggregationOperationImp.java | 4 +-
.../core/filter/JPAArithmeticOperator.java | 4 +-
.../core/filter/JPAArithmeticOperatorImp.java | 24 +-
.../core/filter/JPABooleanOperator.java | 2 +-
.../core/filter/JPABooleanOperatorImp.java | 10 +-
.../core/filter/JPAComparisonOperator.java | 2 +-
.../core/filter/JPAComparisonOperatorImp.java | 2 +-
.../core/filter/JPADBFunctionOperator.java | 13 +-
.../core/filter/JPAExistsOperation.java | 18 +-
.../processor/core/filter/JPAExpression.java | 2 +-
.../core/filter/JPAExpressionVisitor.java | 2 +-
.../core/filter/JPAFilterComplier.java | 2 +-
.../core/filter/JPAFilterComplierAccess.java | 4 +-
.../core/filter/JPAFilterCrossComplier.java | 8 +-
.../core/filter/JPAFilterElementComplier.java | 8 +-
.../filter/JPAFilterRestrictionsWatchDog.java | 2 +-
.../core/filter/JPAJavaFunctionOperator.java | 2 +-
.../core/filter/JPALambdaAllOperation.java | 6 +-
.../core/filter/JPALambdaOperation.java | 2 +-
.../core/filter/JPALiteralOperator.java | 12 +-
.../core/filter/JPAMemberOperator.java | 12 +-
.../core/filter/JPAMethodBasedExpression.java | 6 +-
.../core/filter/JPAMethodCallImp.java | 18 +-
.../core/filter/JPANavigationOperation.java | 23 +-
.../core/filter/JPAOperationConverter.java | 35 +-
.../core/filter/JPAUnaryBooleanOperator.java | 2 +-
.../filter/JPAUnaryBooleanOperatorImp.java | 2 +-
.../jpa/processor/core/filter/JPAVisitor.java | 36 +-
.../core/filter/ODataJPAQueryContext.java | 4 +-
.../core/helper/AbstractWatchDog.java | 4 +-
.../core/modify/JPAConversionHelper.java | 21 +-
.../core/modify/JPACreateResult.java | 39 +-
.../core/modify/JPAEntityBasedResult.java | 2 +-
.../modify/JPAEntityCollectionResult.java | 6 +-
.../modify/JPAEntityNavigationLinkResult.java | 11 +-
.../core/modify/JPAEntityResult.java | 14 +-
.../core/modify/JPAMapBaseResult.java | 10 +-
.../core/modify/JPAMapCollectionResult.java | 7 +-
.../modify/JPAMapNavigationLinkResult.java | 12 +-
.../processor/core/modify/JPAMapResult.java | 14 +-
.../core/modify/JPAUpdateResult.java | 18 +-
.../JPAAbstractRequestProcessor.java | 4 +-
.../processor/JPAActionRequestProcessor.java | 5 +-
.../processor/JPACUDRequestProcessor.java | 34 +-
.../core/processor/JPACoreDebugger.java | 2 +-
.../core/processor/JPAExpandWatchDog.java | 2 +-
.../core/processor/JPAHookFactory.java | 3 +-
.../processor/JPAJavaFunctionProcessor.java | 5 +-
.../core/processor/JPAModifyUtil.java | 32 +-
.../JPANavigationRequestProcessor.java | 16 +-
.../JPAODataInternalRequestContext.java | 17 +-
.../JPAOperationRequestProcessor.java | 14 +-
.../core/processor/JPAProcessorFactory.java | 15 +-
.../core/processor/JPARequestProcessor.java | 4 +-
.../core/query/ComparableByteArray.java | 15 +-
...essionUtil.java => ExpressionUtility.java} | 20 +-
.../core/query/JPAAbstractExpandQuery.java | 16 +-
.../core/query/JPAAbstractJoinQuery.java | 70 +-
.../core/query/JPAAbstractQuery.java | 169 +-
.../core/query/JPAAbstractSubQuery.java | 23 +-
.../core/query/JPACollectionFilterQuery.java | 11 +-
.../core/query/JPACollectionJoinQuery.java | 47 +-
.../core/query/JPACollectionQueryResult.java | 2 +-
.../core/query/JPACountWatchDog.java | 8 +-
.../core/query/JPAExpandFilterQuery.java | 93 +-
.../core/query/JPAExpandItemInfoFactory.java | 40 +-
.../core/query/JPAExpandJoinCountQuery.java | 39 +-
.../core/query/JPAExpandJoinQuery.java | 46 +-
.../core/query/JPAExpandQueryFactory.java | 2 +-
.../core/query/JPAExpandQueryResult.java | 5 +-
.../core/query/JPAExpandSubCountQuery.java | 51 +-
.../core/query/JPAExpandSubQuery.java | 103 +-
.../processor/core/query/JPAJoinQuery.java | 27 +-
.../jpa/processor/core/query/JPAKeyPair.java | 2 +-
.../core/query/JPANavigationCountQuery.java | 8 +-
.../core/query/JPANavigationFilterQuery.java | 11 +-
.../JPANavigationFilterQueryBuilder.java | 18 +-
.../core/query/JPANavigationNullQuery.java | 8 +-
.../core/query/JPANavigationPropertyInfo.java | 40 +-
.../core/query/JPANavigationSubQuery.java | 10 +-
.../core/query/JPAOrderByBuilder.java | 36 +-
.../core/query/JPAOrderByBuilderWatchDog.java | 3 +-
.../core/query/JPAQueryCreationResult.java | 21 +-
.../processor/core/query/JPAQueryPair.java | 17 +-
.../core/query/JPARowNumberFilterQuery.java | 24 +-
.../jpa/processor/core/query/Utility.java | 167 +-
.../serializer/JPAPrimitivePropertyInfo.java | 19 +-
.../core/serializer/JPASerializeFunction.java | 6 +-
.../serializer/JPASerializePrimitive.java | 6 +-
.../JPASerializePrimitiveAbstract.java | 4 +-
.../core/serializer/JPASerializeValue.java | 10 +-
.../core/serializer/JPASerializerFactory.java | 11 +-
.../processor-exceptions-i18n.properties | 10 +-
.../core/api/JPAODataBatchProcessorTest.java | 36 +-
...JPAODataDefaultTransactionFactoryTest.java | 4 +-
.../JPAODataExternalRequestContextTest.java | 12 +-
.../core/api/JPAODataRequestHandlerTest.java | 45 +-
.../api/JPAODataRequestProcessorTest.java | 6 +-
.../JPAODataServiceContextBuilderTest.java | 2 +-
.../JPAExampleCUDRequestHandlerTest.java | 52 +-
.../example/JPAExamplePagingProviderTest.java | 124 +-
.../api/mapper/JakartaRequestMapperTest.java | 491 ++++++
.../api/mapper/JakartaResponseMapperTest.java | 292 ++++
.../JPADefaultDatabaseProcessorTest.java | 34 +-
.../JPA_DERBY_DatabaseProcessorTest.java | 6 +-
.../JPA_HSQLDB_DatabaseProcessorTest.java | 6 +-
.../JPA_POSTSQL_DatabaseProcessorTest.java | 6 +-
.../JPA_XXX_DatabaseProcessorTest.java | 4 +-
.../filter/JPADBFunctionOperatorTest.java | 4 +-
.../JPAFilterRestrictionsWatchDogTest.java | 2 +-
.../filter/JPAJavaFunctionOperatorTest.java | 4 +-
.../processor/core/filter/JPAVisitorTest.java | 9 +-
.../core/filter/ODataJPAQueryContextTest.java | 4 +-
.../filter/TestJPAArithmeticOperator.java | 6 +-
.../filter/TestJPACustomScalarFunctions.java | 9 +-
.../filter/TestJPAOperationConverter.java | 6 +-
.../core/filter/TestJavaFunctions.java | 3 +-
.../core/modify/TestJPACUDRequestHelper.java | 2 +-
.../core/modify/TestJPACreateResult.java | 4 +-
.../JPAActionRequestProcessorTest.java | 4 +-
.../core/processor/JPAClearProcessorTest.java | 14 +-
.../core/processor/JPACoreDebuggerTest.java | 8 +-
.../processor/JPADebugSupportWrapperTest.java | 2 +-
.../core/processor/JPAEmptyDebuggerTest.java | 4 +-
.../JPAFunctionRequestProcessorTest.java | 4 +-
.../core/processor/JPAHookFactoryTest.java | 8 +-
.../JPAJavaFunctionProcessorTest.java | 2 +-
.../JPAODataInternalRequestContextTest.java | 5 +-
.../JPAODataRequestContextBuilderTest.java | 2 +-
.../processor/TestCreateRequestEntity.java | 7 +-
.../processor/TestJPACreateProcessor.java | 2 +-
.../processor/TestJPADeleteProcessor.java | 2 +-
.../processor/TestJPAModifyProcessor.java | 7 +-
.../TestJPAODataRequestContextImpl.java | 2 +-
.../processor/TestJPAUpdateProcessor.java | 6 +-
.../core/query/JPAAbstractQueryTest.java | 106 ++
.../query/JPAExpandJoinCountQueryTest.java | 4 +-
.../core/query/JPAExpandJoinQueryTest.java | 4 +-
.../core/query/JPAExpandQueryResultTest.java | 2 +-
.../query/JPAExpandSubCountQueryTest.java | 2 +-
.../core/query/JPAJoinQueryTest.java | 10 +-
.../processor/core/query/JPAKeyPairTest.java | 2 +-
.../query/JPANavigationCountQueryTest.java | 20 +-
.../JPANavigationFilterQueryBuilderTest.java | 14 +-
.../query/JPANavigationFilterQueryTest.java | 21 +-
.../query/JPANavigationNullQueryTest.java | 21 +-
.../query/JPAOrderByBuilderWatchDogTest.java | 4 +-
.../query/TestJPAExpandQueryCreateResult.java | 4 +-
.../processor/core/query/TestJPAFunction.java | 13 +-
.../core/query/TestJPAFunctionDB.java | 2 +-
.../core/query/TestJPAFunctionJava.java | 9 +-
.../core/query/TestJPAFunctionSerializer.java | 7 +-
.../core/query/TestJPAOrderByBuilder.java | 24 +-
.../TestJPAQueryBuildSelectionPathList.java | 2 +-
.../core/query/TestJPAQueryFromClause.java | 12 +-
.../core/query/TestJPAQueryPair.java | 4 +-
.../core/query/TestJPAQuerySelectClause.java | 6 +-
.../TestJPAQuerySelectWithGroupClause.java | 2 +-
.../query/TestJPAQueryWithProtection.java | 10 +-
.../core/query/TestJPAServerDrivenPaging.java | 13 +-
.../query/TestJPATupleChildConverter.java | 2 +-
...TestJPATupleChildConverterCompoundKey.java | 2 +-
.../ClassWithIdClassConstructor.java | 2 +-
.../core/testobjects/FileAccessConverter.java | 8 +-
.../testobjects/OrganizationWithAudit.java | 4 +-
.../TestFunctionActionConstructor.java | 2 +-
.../testobjects/TestFunctionForFilter.java | 4 +-
.../testobjects/TestFunctionParameter.java | 2 +-
.../core/testobjects/TestJavaActions.java | 20 +-
...eeParameterTransientPropertyConverter.java | 2 +-
...woParameterTransientPropertyConverter.java | 2 +-
.../core/util/AbstractWatchDogTest.java | 3 +-
.../core/util/IntegrationTestHelper.java | 29 +-
.../jpa/processor/core/util/TestBase.java | 9 +-
.../processor/core/util/TestGroupBase.java | 11 +-
.../jpa/processor/core/util/TestHelper.java | 30 +-
.../processor/core/util/TestQueryBase.java | 11 +-
.../jpa/processor/core/util/TupleDouble.java | 20 +-
.../core/util/TupleElementDouble.java | 4 +-
jpa/odata-jpa-spring-support/pom.xml | 2 +-
.../.settings/org.eclipse.jdt.core.prefs | 9 +-
....eclipse.wst.common.project.facet.core.xml | 4 +-
jpa/odata-jpa-test/pom.xml | 25 +-
.../errormodel/AdministrativeInformation.java | 12 +-
.../core/errormodel/ChangeInformation.java | 8 +-
.../CollectionAttributeProtected.java | 18 +-
.../errormodel/ComplexProtectedNoPath.java | 22 +-
.../errormodel/ComplexProtectedWrongPath.java | 22 +-
.../core/errormodel/CompoundKey.java | 4 +-
.../errormodel/DummyPropertyCalculator.java | 12 +-
.../errormodel/EmbeddedKeyPartOfGroup.java | 10 +-
.../core/errormodel/KeyPartOfGroup.java | 8 +-
.../core/errormodel/MandatoryPartOfGroup.java | 18 +-
.../MissingCardinalityAnnotation.java | 11 +-
.../NavigationAttributeProtected.java | 18 +-
.../NavigationPropertyPartOfGroup.java | 16 +-
.../PersonDeepCollectionProtected.java | 16 +-
.../core/errormodel/SingletonAsEntitySet.java | 21 -
.../jpa/processor/core/errormodel/Team.java | 10 +-
...thTransientCalculatorConstructorError.java | 8 +-
.../TeamWithTransientCalculatorError.java | 8 +-
.../TeamWithTransientEmbeddableKey.java | 6 +-
.../errormodel/TeamWithTransientError.java | 8 +-
.../core/errormodel/TeamWithTransientKey.java | 12 +-
...ientPropertyCalculatorTwoConstructors.java | 6 +-
...entPropertyCalculatorWrongConstructor.java | 4 +-
.../core/testmodel/AbstractGroup.java | 6 +-
.../core/testmodel/AccessRightsConverter.java | 4 +-
.../core/testmodel/AddressDeepProtected.java | 6 +-
.../AddressDeepThreeProtections.java | 6 +-
.../testmodel/AdministrativeDivision.java | 28 +-
.../AdministrativeDivisionDescription.java | 12 +-
.../AdministrativeDivisionDescriptionKey.java | 18 +-
.../testmodel/AdministrativeDivisionKey.java | 16 +-
.../testmodel/AdministrativeInformation.java | 16 +-
.../core/testmodel/AnnotationsParent.java | 22 +-
.../core/testmodel/AnnotationsSingleton.java | 18 +-
.../testmodel/AssociationOneToManySource.java | 12 +-
.../testmodel/AssociationOneToManyTarget.java | 12 +-
.../testmodel/AssociationOneToOneSource.java | 14 +-
.../testmodel/AssociationOneToOneTarget.java | 12 +-
.../core/testmodel/BestOrganization.java | 11 +-
.../core/testmodel/BusinessPartner.java | 30 +-
.../testmodel/BusinessPartnerProtected.java | 26 +-
.../core/testmodel/BusinessPartnerRole.java | 24 +-
.../testmodel/BusinessPartnerRoleKey.java | 12 +-
.../BusinessPartnerRoleProtected.java | 22 +-
.../BusinessPartnerRoleWithGroup.java | 22 +-
.../testmodel/BusinessPartnerWithGroups.java | 34 +-
.../core/testmodel/ByteConverter.java | 8 +-
.../core/testmodel/ChangeInformation.java | 14 +-
.../processor/core/testmodel/Collection.java | 20 +-
.../core/testmodel/CollectionDeep.java | 18 +-
.../CollectionFirstLevelComplex.java | 14 +-
.../testmodel/CollectionInnerComplex.java | 6 +-
.../testmodel/CollectionNestedComplex.java | 6 +-
.../CollectionNestedComplexWithTransient.java | 8 +-
.../testmodel/CollectionPartOfComplex.java | 14 +-
.../CollectionSecondLevelComplex.java | 14 +-
.../testmodel/CollectionWithTransient.java | 32 +-
.../jpa/processor/core/testmodel/Comment.java | 14 +-
.../core/testmodel/CommunicationData.java | 12 +-
.../core/testmodel/ComplexBaseType.java | 4 +-
.../core/testmodel/ComplexSubType.java | 4 +-
...ComplexWithTransientComplexCollection.java | 10 +-
.../jpa/processor/core/testmodel/Country.java | 10 +-
.../processor/core/testmodel/CountryKey.java | 14 +-
.../core/testmodel/CountryRestriction.java | 14 +-
.../processor/core/testmodel/CurrentUser.java | 6 +-
.../testmodel/CurrentUserQueryExtension.java | 8 +-
.../core/testmodel/DateConverter.java | 10 +-
.../core/testmodel/DateTimeConverter.java | 8 +-
.../core/testmodel/DateTimeTest.java | 14 +-
.../core/testmodel/DeepProtectedExample.java | 14 +-
.../core/testmodel/DetailSettings.java | 6 +-
.../core/testmodel/DummyEmbeddedToIgnore.java | 10 +-
.../core/testmodel/DummyToBeIgnored.java | 18 +-
.../EmptyQueryExtensionProvider.java | 8 +-
.../core/testmodel/EntityTypeOnly.java | 16 +-
.../core/testmodel/FullNameCalculator.java | 6 +-
.../jpa/processor/core/testmodel/Group.java | 14 +-
.../core/testmodel/GroupNameCalculator.java | 4 +-
.../processor/core/testmodel/ImageLoader.java | 39 +-
.../core/testmodel/InhouseAddress.java | 12 +-
.../core/testmodel/InhouseAddressTable.java | 8 +-
.../testmodel/InhouseAddressWithGroup.java | 12 +-
.../InhouseAddressWithProtection.java | 4 +-
.../InhouseAddressWithThreeProtections.java | 4 +-
.../testmodel/InstanceRestrictionKey.java | 4 +-
.../processor/core/testmodel/JoinComplex.java | 10 +-
.../testmodel/JoinPartnerRoleRelation.java | 6 +-
.../testmodel/JoinPartnerRoleRelationKey.java | 6 +-
.../core/testmodel/JoinRelation.java | 6 +-
.../core/testmodel/JoinRelationKey.java | 14 +-
.../processor/core/testmodel/JoinSource.java | 16 +-
.../processor/core/testmodel/JoinTarget.java | 14 +-
.../processor/core/testmodel/LauFilter.java | 6 +-
.../testmodel/LocalDateTimeConverter.java | 4 +-
.../core/testmodel/LogarithmCalculator.java | 6 +-
.../processor/core/testmodel/Membership.java | 10 +-
.../core/testmodel/MembershipKey.java | 10 +-
.../core/testmodel/Organization.java | 28 +-
.../core/testmodel/OrganizationImage.java | 10 +-
.../jpa/processor/core/testmodel/Person.java | 28 +-
.../core/testmodel/PersonDeepProtected.java | 20 +-
.../testmodel/PersonDeepProtectedHidden.java | 10 +-
.../processor/core/testmodel/PersonImage.java | 10 +-
.../core/testmodel/PostalAddressData.java | 42 +-
.../testmodel/PostalAddressDataWithGroup.java | 40 +-
.../processor/core/testmodel/SalesTeam.java | 8 +-
.../processor/core/testmodel/Singleton.java | 14 +-
.../testmodel/StreetPropertyCalculator.java | 6 +-
.../core/testmodel/StringConverter.java | 8 +-
.../core/testmodel/SupportRelationship.java | 8 +-
.../jpa/processor/core/testmodel/Team.java | 10 +-
.../testmodel/TemporalWithValidityPeriod.java | 10 +-
.../TemporalWithValidityPeriodKey.java | 4 +-
.../core/testmodel/TestDataConstants.java | 16 -
.../core/testmodel/TransientRefComplex.java | 12 +-
.../core/testmodel/TransientRefIgnore.java | 10 +-
.../core/testmodel/UUIDToBinaryConverter.java | 18 +-
.../core/testmodel/UUIDToStringConverter.java | 4 +-
.../jpa/processor/core/testmodel/User.java | 8 +-
.../core/util/ServletInputStreamDouble.java | 20 +-
.../main/resources/META-INF/persistence.xml | 10 +-
.../processor/test/AbstractConverterTest.java | 2 +-
.../jpa/processor/test/TestAssociations.java | 18 +-
.../processor/test/TestCriteriaBuilder.java | 34 +-
.../test/TestEqualHashCodeMethods.java | 10 +-
.../TestEqualHashCodeMethodsErrorModel.java | 9 +-
.../TestEqualHashCodeMethodsTestModel.java | 7 +-
.../jpa/processor/test/TestFunctions.java | 27 +-
.../processor/test/TestFunctionsHSQLDB.java | 23 +-
...PropertyCalculatorTwoConstructorsTest.java | 2 +-
...ropertyCalculatorWrongConstructorTest.java | 2 +-
jpa/odata-jpa-vocabularies/pom.xml | 8 +-
.../core/edm/mapper/vocabularies/Action.java | 86 +-
.../vocabularies/CsdlDocumentReader.java | 176 +-
.../mapper/vocabularies/EdmxReference.java | 58 +-
.../vocabularies/EdmxReferenceInclude.java | 50 +-
.../edm/mapper/vocabularies/Function.java | 106 +-
.../edm/mapper/vocabularies/Parameter.java | 124 +-
.../edm/mapper/vocabularies/ReturnType.java | 112 +-
.../edm/mapper/vocabularies/TermTest.java | 232 +--
.../vocabularies/TestAnnotationSchema.java | 774 ++++-----
.../vocabularies/TestCsdlDocumentReader.java | 206 +--
jpa/pom.xml | 21 +-
579 files changed, 7876 insertions(+), 6458 deletions(-)
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/pom.xml
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/META-INF/maven/archetype-metadata.xml
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/pom.xml
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/security/xs-security.json
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/SpringApp.java
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/config/EclipseLinkJpaConfiguration.java
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/config/ProcessorConfiguration.java
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/controller/ODataController.java
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/EntityTemplate.java
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplate.java
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplateKey.java
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/application-test.yml
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/application.yml
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/db/migration/V1_0__jpa.sql
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/java/AppTest.java
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/java/integrationtest/ControllerTest.java
delete mode 100644 jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/resources/requests/CreateEntityViaBatch.txt
delete mode 100644 jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmAsEntitySet.java
delete mode 100644 jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/reuse/OffsetDateTimeConverter.java
create mode 100644 jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationHelperTest.java
create mode 100644 jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/TestActionCollection.java
create mode 100644 jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/TestCollectionInterface.java
create mode 100644 jpa/odata-jpa-processor-cb/src/test/java/com/sap/olingo/jpa/processor/cb/impl/SubqueryRootImplTest.java
create mode 100644 jpa/odata-jpa-processor-parallel/src/test/java/com/sap/olingo/jpa/processor/test/util/JakartaRequestMapper.java
create mode 100644 jpa/odata-jpa-processor-parallel/src/test/java/com/sap/olingo/jpa/processor/test/util/JakartaResponseMapper.java
create mode 100644 jpa/odata-jpa-processor-parallel/src/test/java/com/sap/olingo/jpa/processor/test/util/JakartaServletInputStream.java
create mode 100644 jpa/odata-jpa-processor-parallel/src/test/java/com/sap/olingo/jpa/processor/test/util/JakartaServletOutputStream.java
create mode 100644 jpa/odata-jpa-processor/src/main/java/com/sap/olingo/jpa/processor/core/api/mapper/JakartaRequestMapper.java
create mode 100644 jpa/odata-jpa-processor/src/main/java/com/sap/olingo/jpa/processor/core/api/mapper/JakartaResponseMapper.java
create mode 100644 jpa/odata-jpa-processor/src/main/java/com/sap/olingo/jpa/processor/core/api/mapper/JakartaServletInputStream.java
create mode 100644 jpa/odata-jpa-processor/src/main/java/com/sap/olingo/jpa/processor/core/api/mapper/JakartaServletOutputStream.java
rename jpa/odata-jpa-processor/src/main/java/com/sap/olingo/jpa/processor/core/query/{ExpressionUtil.java => ExpressionUtility.java} (91%)
create mode 100644 jpa/odata-jpa-processor/src/test/java/com/sap/olingo/jpa/processor/core/api/mapper/JakartaRequestMapperTest.java
create mode 100644 jpa/odata-jpa-processor/src/test/java/com/sap/olingo/jpa/processor/core/api/mapper/JakartaResponseMapperTest.java
create mode 100644 jpa/odata-jpa-processor/src/test/java/com/sap/olingo/jpa/processor/core/query/JPAAbstractQueryTest.java
delete mode 100644 jpa/odata-jpa-test/src/main/java/com/sap/olingo/jpa/processor/core/errormodel/SingletonAsEntitySet.java
delete mode 100644 jpa/odata-jpa-test/src/main/java/com/sap/olingo/jpa/processor/core/testmodel/TestDataConstants.java
diff --git a/.github/workflows/archetype.yml b/.github/workflows/archetype.yml
index cfb5b2f00..b8e147a3d 100644
--- a/.github/workflows/archetype.yml
+++ b/.github/workflows/archetype.yml
@@ -20,5 +20,7 @@ jobs:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- - name: Build with Maven
+ - name: 1. Build JPA
+ run: cd ./jpa && mvn clean -Dmaven.test.skip
+ - name: 2. Build and test archetype
run: cd ./jpa-archetype && mvn clean install archetype:integration-test
diff --git a/LICENSE.txt b/LICENSE.txt
index f6b599de5..826b70214 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright 2016-2021 SAP SE or an SAP affiliate company and olingo-jpa-processor-v4 contributors
+ Copyright 2016-2023 SAP SE or an SAP affiliate company and olingo-jpa-processor-v4 contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/README.md b/README.md
index c3f5a529c..fd0b6589f 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
[![GitHub release](https://img.shields.io/github/release-pre/sap/olingo-jpa-processor-v4.svg?color=orange&label=release)](https://github.com/SAP/olingo-jpa-processor-v4/releases/)
[![Project Map](https://sourcespy.com/shield.svg)](https://sourcespy.com/github/sapolingojpaprocessorv4/)
-The JPA Processor shall fill the gap between [Olingo V4](https://olingo.apache.org/doc/odata4/index.html) and the database if [JPA](https://en.wikipedia.org/wiki/Java_Persistence_API) is used for object-relational mapping.
+The JPA Processor shall fill the gap between [Olingo V4](https://olingo.apache.org/doc/odata4/index.html) and the database, if [JPA](https://en.wikipedia.org/wiki/Java_Persistence_API) is used for object-relational mapping. If you want to be updated about Olingo changes subscribe to Olingo's [user mailing list](user-subscribe@olingo.apache.org).
At the current state the JPA Processor provide support for:
@@ -22,10 +22,22 @@ The tutorials from the previous major version is still available under: [Tutoria
## Requirements
-The JPA Processor requires, minimum Java version [1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html). The current version comes with [Olingo 4.9.0](https://github.com/apache/olingo-odata4). If you want to be updated about Olingo changes subscribe to Olingo's [user mailing list](user-subscribe@olingo.apache.org).
+As of now, the JPA Processor has two major versions 1.1.x and 2.x.x.
+
+### 1.1.x
+
+The JPA Processor requires, minimum Java version [1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html). The current version comes with [Olingo 4.9.0](https://github.com/apache/olingo-odata4).
Even so no JPA implementation is preferred, as long as it supports [JSR-338 Java Persistence 2.2](https://jcp.org/en/jsr/detail?id=338), it has to be stated that all test have been performed with [Eclipselink 2.7.9](http://www.eclipse.org/eclipselink/). If you have any problem e.g. with [Hibernate](http://hibernate.org) or [OpenJPA](https://openjpa.apache.org/), create an [issue](https://github.com/SAP/olingo-jpa-processor-v4/issues), but there is no guaranty that it can be solved, as e.g. Hibernate implements some JPA interfaces "differently" than EclipseLink.
+There is no father development for this major version.
+
+### 2.x.x
+
+The current version is based on [Jakarta 10](https://projects.eclipse.org/releases/jakarta-10), so [JPA 3.1.0](https://projects.eclipse.org/projects/ee4j.jpa/releases/3.1) or [Jakarta Persistence Specification](https://github.com/jakartaee/persistence), receptively and [Jakarta Servlet 6.0](https://projects.eclipse.org/projects/ee4j.servlet/releases/6.0). Test are performed using [Eclipselink 4.0.2](https://projects.eclipse.org/projects/ee4j.eclipselink/releases/4.0.2), but there is no real dependency to a JPA implementation. This versions require Java [17](https://sap.github.io/SapMachine/#download).
+
+The current version comes with [Olingo 4.9.0](https://github.com/apache/olingo-odata4), which does not support Jakarta. Till Olingo supports Jakarta, requests get mapped by the JPA Processor.
+
## Download and Installation
The JPA Processor is a collection of [Maven](https://maven.apache.org) projects. To use it you need to
@@ -35,7 +47,7 @@ clone the repository, import the projects and declare a dependency to either the
com.sap.olingoodata-jpa-metadata
- 1.1.1
+ 2.0.0
```
@@ -45,7 +57,7 @@ Or to the complete processor:
com.sap.olingoodata-jpa-processor
- 1.1.1
+ 2.0.0
```
@@ -53,7 +65,6 @@ Or to the complete processor:
The core of this project became stable. Some of the addons are still in the state of incubation, so some incompatible changes my come up. Nevertheless feel free to use the JPA processor and the addons where ever it helps.
-
## Contributing
If you want to report a bug or have suggestions to improve the JPA Processor, read up on our [guidelines for contributing](./CONTRIBUTING.md) to learn about our submission process, coding rules and more.
@@ -64,6 +75,7 @@ We'd love all and any contributions.
The flowing extensions/changes are planned:
+* Support of method call at $orderby
* Tenant depended metadata
* Enable hooks for retrieving data
* Support of $ref
@@ -82,24 +94,8 @@ Detailed information including third-party components and their licensing/copyri
|Version|Changes|Incompatible Changes|
|-- |-- |-- |
-|0.2.4|- Switch to Olingo version 4.4.0 - Support of Enumeration Types - Support of $count at $expand|Yes|
-|0.2.6|- Solution for issue [#21](https://github.com/SAP/olingo-jpa-processor-v4/issues/21) - JPA Join tables can be used e.g. for Many To Many relationship (issue [#22](https://github.com/SAP/olingo-jpa-processor-v4/issues/22)). If such relation shall be used in a filter a corresponding JPA entity is required, which can be hidden from the API using @EdmIgnore. Please be aware that in case both source and target are subtypes Eclipselink (version 2.7.1 used) may get confused when generating a subquery for filtering, see [Bug 529565](https://bugs.eclipse.org/bugs/show_bug.cgi?id=529565) | No|
-|0.2.7|- Solution for issue [#29](https://github.com/SAP/olingo-jpa-processor-v4/issues/29) - Solution for issue [#35](https://github.com/SAP/olingo-jpa-processor-v4/issues/35) - Solution for issue [#37](https://github.com/SAP/olingo-jpa-processor-v4/issues/37) |No|
-|0.2.8|- Support of Collection Properties - New tutorials 1.7 Suppressing Elements and 1.13 Collection Properties |No|
-|0.2.9|- Support on top level server driven paging - New tutorial 4.3 Server Driven Paging |No|
-|0.2.10|- Handling of Content-Id in batch requests - Update to Olingo 4.5.0 - Update tutorial 1.6, 3.3, 3.5 and 3.6 |No|
-|0.3.1|- Support of instance based authorizations - Solution for issue [#60](https://github.com/SAP/olingo-jpa-processor-v4/issues/60) - Solution for issue [#49](https://github.com/SAP/olingo-jpa-processor-v4/issues/49) - Correct typo in interface JPAODataPagingProvider - New tutorials 2.3, 4.4 |Yes|
-|0.3.2|- Lift unit tests to JUnit 5 - Correction of http return codes on empty responses |No|
-|0.3.3|- Support of PUT requests on collection properties and simple primitive properties - Update to Olingo 4.6.0 - Solution for issue [#69](https://github.com/SAP/olingo-jpa-processor-v4/issues/69) - Solution for issue [#71](https://github.com/SAP/olingo-jpa-processor-v4/issues/71) - Update tutorial [4.4](jpa-tutorial/Tutorials/SpecialTopics/4-4-InstanceBasedAuthorizations.md)|No
-|0.3.4|- Support of $select as part of $expand - Support of field groups - Introduction of a request context, which includes deprecation of methods - Etag now written into response e.g. @odata.etag when JSON was requested - Solution for issue [#78](https://github.com/SAP/olingo-jpa-processor-v4/issues/78) - Updated tutorials: [2.2](jpa-tutorial/Tutorials/RetrieveData/2-2-RetrievingData.md), [2.3](jpa-tutorial/Tutorials/RetrieveData/2-3-UsingFunctions.md), [3.1](jpa-tutorial/Tutorials/ChangeData/3-1-Preparation.md), [3.2](jpa-tutorial/Tutorials/ChangeData/3-2-CreatingEntities.md), [4.4](jpa-tutorial/Tutorials/SpecialTopics/4-4-InstanceBasedAuthorizations.md) |Yes|
-|0.3.5|- Extension of session context, so an entity manager factory can be provided. This will allow creating Spring based services without `persistence.xml` file - Solution for issue [#85](https://github.com/SAP/olingo-jpa-processor-v4/issues/85) - Usage of Olingo JSON deserializer for CUD requests - Extension of session context, so an own Edm Name Builder can be provided|Yes|
-|0.3.6|- Enable more flexible transaction handling - Part solution for issue [#83](https://github.com/SAP/olingo-jpa-processor-v4/issues/83) - Increase support of Spring by performing request mapping in case a mapping path is provided via the service context|No|
-|0.3.7| - Update Olingo dependency to 4.7.0|No|
-|0.3.8| - Update Olingo dependency to 4.7.1 - Support of `java.time` data types. Prerequisite is the usage of JPA 2.2. - Support of Absolute Context URL. See issue [#103](https://github.com/SAP/olingo-jpa-processor-v4/issues/103) - Temporal data types do not longer require a Precision [#98](https://github.com/SAP/olingo-jpa-processor-v4/issues/98) Support of MappedSuperclass|No|
-|0.3.9| - Solutions for issue [#112](https://github.com/SAP/olingo-jpa-processor-v4/issues/112) - Solutions for issue [#114](https://github.com/SAP/olingo-jpa-processor-v4/issues/114)|No|
-|0.3.10| - Update Olingo dependency to 4.8.0 - Deprecation of ```setExternalName``` in ```IntermediateModelItemAccess``` - Solutions for issue [#134](https://github.com/SAP/olingo-jpa-processor-v4/issues/136) - Solution for issue [#136](https://github.com/SAP/olingo-jpa-processor-v4/issues/136) |No|
-|0.3.11| - Solutions for issue [#138](https://github.com/SAP/olingo-jpa-processor-v4/issues/138)|No|
|1.0.6|- Transient Properties - Singletons - Entity Types without Entity Set - Rework Request Context - Deprecation of annotation EdmAsEntitySet |Yes|
|1.0.8|- Solution for issue [#145](https://github.com/SAP/olingo-jpa-processor-v4/issues/145) |No|
|1.0.9|- Update Olingo dependency to 4.9.0 - Solutions for issues [#164](https://github.com/SAP/olingo-jpa-processor-v4/issues/164), [#155](https://github.com/SAP/olingo-jpa-processor-v4/issues/155), [#191](https://github.com/SAP/olingo-jpa-processor-v4/issues/191), [#156](https://github.com/SAP/olingo-jpa-processor-v4/issues/156) |No|
-|1.1.1|- Enable action overload - Basic support of OData annotations - Solution of issues [#207](https://github.com/SAP/olingo-jpa-processor-v4/issues/207), [#211](https://github.com/SAP/olingo-jpa-processor-v4/issues/211), [#212](https://github.com/SAP/olingo-jpa-processor-v4/issues/212), [#213](https://github.com/SAP/olingo-jpa-processor-v4/issues/213), [#214](https://github.com/SAP/olingo-jpa-processor-v4/issues/214),[#218](https://github.com/SAP/olingo-jpa-processor-v4/issues/218)|No|
\ No newline at end of file
+|1.1.1|- Enable action overload - Basic support of OData annotations - Solution of issues [#207](https://github.com/SAP/olingo-jpa-processor-v4/issues/207), [#211](https://github.com/SAP/olingo-jpa-processor-v4/issues/211), [#212](https://github.com/SAP/olingo-jpa-processor-v4/issues/212), [#213](https://github.com/SAP/olingo-jpa-processor-v4/issues/213), [#214](https://github.com/SAP/olingo-jpa-processor-v4/issues/214),[#218](https://github.com/SAP/olingo-jpa-processor-v4/issues/218)|No|
+|2.0.0|- Minimum Java release now 17 - Switch to Jakarta Persistency - Support of Spring Boot 3.x - JPAEdmMetadataPostProcessor became an interface|Yes|
diff --git a/additionalWords.directory b/additionalWords.directory
index 61ff23737..4cb830223 100644
--- a/additionalWords.directory
+++ b/additionalWords.directory
@@ -1,6 +1,5 @@
Sortable
Annotatable
-Meassument
Metadata
serializer
es
@@ -49,3 +48,13 @@ apis
SQL
Visitable
Rethrow
+Unboxed
+UUID
+JSON
+Impl
+Servlet
+Jakarta
+CUD
+JPAO
+subquery
+
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/pom.xml b/jpa-archetype/odata-jpa-archetype-spring-scp/pom.xml
deleted file mode 100644
index 068c6d5e7..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/pom.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
- 4.0.0
-
- com.sap.olingo
- odata-jpa-archetype
- 1.1.1
-
- odata-jpa-archetype-spring-scp
- odata-jpa-archetype
-
-
- https://github.com/SAP/olingo-jpa-processor-v4
- maven-archetype
-
-
-
-
- org.apache.maven.archetype
- archetype-packaging
- 3.1.1
-
-
-
-
-
- org.apache.maven.plugins
- maven-archetype-plugin
- 3.2.1
-
-
-
-
-
\ No newline at end of file
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/META-INF/maven/archetype-metadata.xml b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/META-INF/maven/archetype-metadata.xml
deleted file mode 100644
index a55ac5309..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
- src/main/java
-
- **/*.java
-
-
-
- src/test/java
-
- **/*.java
-
-
-
- src/main/resources
-
- **/*.sql
- **/*.json
- **/*.xml
- **/*.properties
- **/*.yml
-
-
-
- src/test/resources
-
- **/*.txt
-
-
-
-
-
-
-
-
- EntityTemplate
-
-
- ValueObjectTemplate
-
-
- 9010
-
-
-
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/pom.xml b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/pom.xml
deleted file mode 100644
index f0c84a57a..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/pom.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
- 4.0.0
- ${groupId}
- ${artifactId}
- ${version}
- jar
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.7.6
-
-
-
-
- 1.1.1
- 1.8
- 2.7.9
- 2.2.1
-
-
-
-
- org.springframework.boot
- spring-boot-starter
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- junit
- junit
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- org.hibernate
- hibernate-entitymanager
-
-
- org.hibernate
- hibernate-core
-
-
-
-
- org.eclipse.persistence
- javax.persistence
- ${jpa.version}
- compile
-
-
- org.eclipse.persistence
- eclipselink
- ${eclipselink.version}
-
-
- com.sap.olingo
- odata-jpa-processor
- ${processor.version}
-
-
- com.sap.olingo
- odata-jpa-processor-cb
- ${processor.version}
-
-
- com.sap.olingo
- odata-jpa-spring-support
- ${processor.version}
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
- org.flywaydb
- flyway-core
- 8.4.0
-
-
- com.h2database
- h2
- 2.2.220
- runtime
-
-
- org.springframework.boot
- spring-boot-devtools
- true
-
-
- io.rest-assured
- spring-mock-mvc
- test
-
-
- org.junit.jupiter
- junit-jupiter
- 5.4.2
- test
-
-
- org.junit.platform
- junit-platform-launcher
- 1.4.2
- test
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/security/xs-security.json b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/security/xs-security.json
deleted file mode 100644
index 382c88908..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/security/xs-security.json
+++ /dev/null
@@ -1,69 +0,0 @@
-{
- "xsappname" : "${app-name}",
- "description": "Enabled bulletinboard for multi tenants",
- "tenant-mode": "shared",
- "scopes" : [
- {
- "name" : "$XSAPPNAME.Display",
- "description" : "Display Business Partner Master"
- },
- {
- "name" : "$XSAPPNAME.Update",
- "description" : "Update Business Partner Master"
- }
- ],
- "attributes" : [
- {
- "name": "id_range",
- "description": "Range of business partner id",
- "valueType" : "int",
- "valueRequired" : true
-
- }
- ],
- "role-templates": [
- {
- "name": "ViewerAll",
- "description": "View all Business Partner Master",
- "scope-references": [
- "$XSAPPNAME.Display"
- ],
- "attribute-references" : [
- {
- "name" : "id_range",
- "default-values" : ["*"]
- }
- ]
- },
- {
- "name": "MaintainAll",
- "description": "Maintain Business Partner Master",
- "scope-references": [
- "$XSAPPNAME.Display",
- "$XSAPPNAME.Update"
- ],
- "attribute-references" : [
- {
- "name" : "id_range",
- "default-values" : ["*"]
- }
- ]
- }
- ],
- "role-collections": [
- {
- "name": "RC_ViewerAll",
- "description": "Viewer (public)",
- "role-template-references": [
- "$XSAPPNAME.ViewerAll"
- ]
- },
- {
- "name": "RC_MaintainAll",
- "description": "Business Partner (CRUD, no restriction)",
- "role-template-references": [
- "$XSAPPNAME.MaintainAll"
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/SpringApp.java b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/SpringApp.java
deleted file mode 100644
index c704b151d..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/SpringApp.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package $package;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class SpringApp {
-
- public static void main(String[] args) {
- SpringApplication.run(SpringApp.class, args);
- }
-}
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/config/EclipseLinkJpaConfiguration.java b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/config/EclipseLinkJpaConfiguration.java
deleted file mode 100644
index 8fad9e29c..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/config/EclipseLinkJpaConfiguration.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package ${package}.config;
-
-import static org.eclipse.persistence.config.PersistenceUnitProperties.CACHE_SHARED_DEFAULT;
-import static org.eclipse.persistence.config.PersistenceUnitProperties.CONNECTION_POOL_MAX;
-import static org.eclipse.persistence.config.PersistenceUnitProperties.DDL_GENERATION;
-import static org.eclipse.persistence.config.PersistenceUnitProperties.LOGGING_LEVEL;
-import static org.eclipse.persistence.config.PersistenceUnitProperties.TRANSACTION_TYPE;
-import static org.eclipse.persistence.config.PersistenceUnitProperties.WEAVING;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.sql.DataSource;
-
-import org.eclipse.persistence.logging.SessionLog;
-import ${package}.model.EntityTemplate;
-import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration;
-import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
-import org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers;
-import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
-import org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter;
-import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter;
-import org.springframework.transaction.jta.JtaTransactionManager;
-
-@Configuration
-public class EclipseLinkJpaConfiguration extends JpaBaseConfiguration {
- @Value("${odata.jpa.punit_name}")
- private String punit;
-
- protected EclipseLinkJpaConfiguration(DataSource dataSource, JpaProperties properties,
- ObjectProvider jtaTransactionManager,
- ObjectProvider transactionManagerCustomizers) {
- super(dataSource, properties, jtaTransactionManager, transactionManagerCustomizers);
- }
-
- @Override
- protected AbstractJpaVendorAdapter createJpaVendorAdapter() {
- return new EclipseLinkJpaVendorAdapter();
- }
-
- @Override
- protected Map getVendorProperties() {
- // https://stackoverflow.com/questions/10769051/eclipselinkjpavendoradapter-instead-of-hibernatejpavendoradapter-issue
- HashMap jpaProperties = new HashMap<>();
- jpaProperties.put(WEAVING, "false");
- // No table generation by JPA
- jpaProperties.put(DDL_GENERATION, "none");
- jpaProperties.put(LOGGING_LEVEL, SessionLog.FINE_LABEL);
- jpaProperties.put(TRANSACTION_TYPE, "RESOURCE_LOCAL");
- // do not cache entities locally, as this causes problems if multiple application instances are used
- jpaProperties.put(CACHE_SHARED_DEFAULT, "false");
- // You can also tweak your application performance by configuring your database connection pool.
- // https://www.eclipse.org/eclipselink/documentation/2.7/jpa/extensions/persistenceproperties_ref.htm#connectionpool
- jpaProperties.put(CONNECTION_POOL_MAX, 50);
- return jpaProperties;
- }
-
- @Bean
- public LocalContainerEntityManagerFactoryBean customerEntityManagerFactory(
- final EntityManagerFactoryBuilder builder, @Autowired final DataSource ds) {
-
- return builder
- .dataSource(ds)
- .packages(EntityTemplate.class)
- .properties(getVendorProperties())
- .jta(false)
- .build();
- }
-}
\ No newline at end of file
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/config/ProcessorConfiguration.java b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/config/ProcessorConfiguration.java
deleted file mode 100644
index 0b11836d2..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/config/ProcessorConfiguration.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package ${package}.config;
-
-import static org.springframework.web.context.WebApplicationContext.SCOPE_REQUEST;
-
-import javax.persistence.EntityManagerFactory;
-
-import org.apache.olingo.commons.api.ex.ODataException;
-import org.apache.olingo.server.api.debug.DefaultDebugSupport;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Scope;
-
-import com.sap.olingo.jpa.processor.core.api.JPAODataRequestContext;
-import com.sap.olingo.jpa.processor.core.api.JPAODataServiceContext;
-import com.sap.olingo.jpa.processor.core.api.JPAODataSessionContextAccess;
-import com.sap.olingo.jpa.processor.core.api.example.JPAExampleCUDRequestHandler;
-
-@Configuration
-public class ProcessorConfiguration {
- @Value("${odata.jpa.punit_name}")
- private String punit;
- @Value("${odata.jpa.root_packages}")
- private String rootPackages;
-
- @Bean
- public JPAODataSessionContextAccess sessionContext(@Autowired final EntityManagerFactory emf) throws ODataException {
-
- return JPAODataServiceContext.with()
- .setPUnit(punit)
- .setEntityManagerFactory(emf)
- .setTypePackage(rootPackages)
- .setRequestMappingPath("${punit}/v1")
- .build();
- }
-
- @Bean
- @Scope(scopeName = SCOPE_REQUEST)
- public JPAODataRequestContext requestContext() {
-
- return JPAODataRequestContext.with()
- .setCUDRequestHandler(new JPAExampleCUDRequestHandler())
- .setDebugSupport(new DefaultDebugSupport())
- .build();
- }
-}
\ No newline at end of file
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/controller/ODataController.java b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/controller/ODataController.java
deleted file mode 100644
index 051d1bf33..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/controller/ODataController.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package ${package}.controller;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.olingo.commons.api.ex.ODataException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.context.annotation.RequestScope;
-
-import com.sap.olingo.jpa.processor.core.api.JPAODataRequestContext;
-import com.sap.olingo.jpa.processor.core.api.JPAODataRequestHandler;
-import com.sap.olingo.jpa.processor.core.api.JPAODataSessionContextAccess;
-
-@RestController
-@RequestMapping("${punit}/v1/**")
-@RequestScope
-public class ODataController {
-
- @Autowired
- private JPAODataSessionContextAccess serviceContext;
- @Autowired
- private JPAODataRequestContext requestContext;
-
- @RequestMapping(value = "**", method = { RequestMethod.GET, RequestMethod.PATCH, // NOSONAR
- RequestMethod.POST, RequestMethod.DELETE })
- public void crud(final HttpServletRequest req, final HttpServletResponse resp) throws ODataException {
-
- new JPAODataRequestHandler(serviceContext, requestContext).process(req, resp);
- }
-}
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/EntityTemplate.java b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/EntityTemplate.java
deleted file mode 100644
index 4f1d7acea..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/EntityTemplate.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package ${package}.model;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.OneToMany;
-import javax.persistence.SequenceGenerator;
-import javax.persistence.Table;
-
-@Entity(name = "${entity-table}")
-@Table(schema = "\"${schema}\"", name = "\"${entity-table}\"")
-public class EntityTemplate {
- @Id
- @Column(name = "\"ID\"", length = 32)
- @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TemplateId")
- @SequenceGenerator(name = "TemplateId", sequenceName = "\"${schema}\".\"TemplateId\"", allocationSize = 1)
- private Long id;
-
- @Column(name = "\"Data\"", length = 255)
- private String data;
-
- @OneToMany(mappedBy = "entity", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- private Collection valueObjects = new ArrayList<>();
-
- public Long getId() {
- return id;
- }
-
- public void setId(final Long id) {
- this.id = id;
- }
-
- public String getData() {
- return data;
- }
-
- public void setData(final String data) {
- this.data = data;
- }
-
- public Collection getValueObjects() {
- return valueObjects;
- }
-
- public void setValueObjects(Collection valueObjects) {
- this.valueObjects = valueObjects;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((id == null) ? 0 : id.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null) return false;
- if (getClass() != obj.getClass()) return false;
- EntityTemplate other = (EntityTemplate) obj;
- if (id == null) {
- if (other.id != null) return false;
- } else if (!id.equals(other.id)) return false;
- return true;
- }
-}
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplate.java b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplate.java
deleted file mode 100644
index 2f0d3ac4b..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplate.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package ${package}.model;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Id;
-import javax.persistence.IdClass;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-
-@IdClass(ValueObjectTemplateKey.class)
-@Entity(name = "${value-object-table}")
-@Table(schema = "\"${schema}\"", name = "\"${value-object-table}\"")
-public class ValueObjectTemplate {
- @Id
- @Column(name = "\"ID\"", length = 32)
- private String id;
-
- @Id
- @Column(name = "\"Entity\"", length = 32)
- private Long entityId;
-
- @Column(name = "\"Data\"", length = 255)
- private String data;
-
- @ManyToOne(optional = false, fetch = FetchType.LAZY)
- @JoinColumn(name = "\"Entity\"", insertable = false, updatable = false)
- private EntityTemplate entity;
-
- public String getId() {
- return id;
- }
-
- public void setId(final String id) {
- this.id = id;
- }
-
- public Long getEntityId() {
- return entityId;
- }
-
- public void setEntityId(final Long entityId) {
- this.entityId = entityId;
- }
-
- public String getData() {
- return data;
- }
-
- public void setData(final String data) {
- this.data = data;
- }
-
- public EntityTemplate getEntity() {
- return entity;
- }
-
- public void setEntity(final EntityTemplate entity) {
- this.entityId = entity.getId();
- this.entity = entity;
- }
-}
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplateKey.java b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplateKey.java
deleted file mode 100644
index 7371e40bd..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplateKey.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package ${package}.model;
-
-import java.io.Serializable;
-
-import javax.persistence.Id;
-
-public class ValueObjectTemplateKey implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- @Id
- private String id;
-
- @Id
- private Long entityId;
-
- Long getEntityId() {
- return entityId;
- }
-
- void setEntityId(final Long entityId) {
- this.entityId = entityId;
- }
-
- String getId() {
- return id;
- }
-
- void setId(final String id) {
- this.id = id;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((entityId == null) ? 0 : entityId.hashCode());
- result = prime * result + ((id == null) ? 0 : id.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (obj == null) return false;
- if (getClass() != obj.getClass()) return false;
- ValueObjectTemplateKey other = (ValueObjectTemplateKey) obj;
- if (entityId == null) {
- if (other.entityId != null) return false;
- } else if (!entityId.equals(other.entityId)) return false;
- if (id == null) {
- if (other.id != null) return false;
- } else if (!id.equals(other.id)) return false;
- return true;
- }
-}
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/application-test.yml b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/application-test.yml
deleted file mode 100644
index d4dd5e492..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/application-test.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-logging:
- level:
- org:
- springframework: DEBUG
-odata:
- jpa:
- punit_name: ${punit}
- root_packages: ${package}
-server:
- port: ${port}
-spring:
- datasource:
- url: jdbc:h2:mem:testdb;MODE=PostgreSQL
- driverClassName: org.h2.Driver
- username: sa
- password: ''
- flyway:
- enabled: true
- schemas:
- - ${schema}
- servlet:
- multipart:
- enabled: false
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/application.yml b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/application.yml
deleted file mode 100644
index aa82b9ce9..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/application.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-logging:
- level:
- org:
- springframework: INFO
- com:
- sap:
- olingo:
- jpa: TRACE
-odata:
- jpa:
- punit_name: ${punit}
- root_packages: ${package}
-server:
- port: ${port}
-spring:
- datasource:
- driver-class-name: org.hsqldb.jdbc.JDBCDriver
- password: ''
- url: jdbc:hsqldb:file:${punit};DB_CLOSE_DELAY=-1
- username: sa
- flyway:
- password: ''
- schemas:
- - ${schema}
- url: jdbc:hsqldb:file:${punit};DB_CLOSE_DELAY=-1
- user: sa
- servlet:
- multipart:
- enabled: false
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/db/migration/V1_0__jpa.sql b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/db/migration/V1_0__jpa.sql
deleted file mode 100644
index e60317fd8..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/main/resources/db/migration/V1_0__jpa.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-SET schema "${schema}";
-
-CREATE SEQUENCE "TemplateId";
-
-CREATE TABLE "${entity-table}"(
- "ID" BIGINT NOT NULL ,
- "Data" VARCHAR(255),
- PRIMARY KEY ("ID"));
-
-CREATE TABLE "${value-object-table}"(
- "Entity" BIGINT NOT NULL ,
- "ID" VARCHAR(32) NOT NULL ,
- "Data" VARCHAR(255),
- PRIMARY KEY ("Entity", "ID"));
\ No newline at end of file
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/java/AppTest.java b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/java/AppTest.java
deleted file mode 100644
index 183a67179..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/java/AppTest.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package ${package};
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import org.junit.jupiter.api.Test;
-
-/**
- * Unit test for simple App.
- */
-
-public class AppTest {
-
- /**
- * Rigourous Test :-)
- */
- @Test
- public void testApp() {
- assertTrue(true);
- }
-}
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/java/integrationtest/ControllerTest.java b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/java/integrationtest/ControllerTest.java
deleted file mode 100644
index d1144979f..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/java/integrationtest/ControllerTest.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package ${package}.integrationtest;
-
-import static io.restassured.module.mockmvc.RestAssuredMockMvc.given;
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.hasItems;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import java.io.File;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Collection;
-
-import org.apache.olingo.commons.api.http.HttpStatusCode;
-import ${package}.SpringApp;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.web.server.LocalServerPort;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit.jupiter.SpringExtension;
-import org.springframework.web.context.WebApplicationContext;
-
-import io.restassured.http.ContentType;
-import io.restassured.module.mockmvc.RestAssuredMockMvc;
-import io.restassured.path.xml.XmlPath;
-import io.restassured.path.xml.element.Node;
-
-@ExtendWith(SpringExtension.class)
-@SpringBootTest(classes = SpringApp.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@TestPropertySource(properties = { "spring.config.location=classpath:application-test.yml" })
-public class ControllerTest {
-
- @Autowired
- private WebApplicationContext context;
- @LocalServerPort
- private int port;
-
- @BeforeEach
- public void setup() {
- RestAssuredMockMvc.webAppContextSetup(context);
- }
-
- @Test
- public void testRetrieveServiceDocument() {
- final String xml = given()
- .accept(ContentType.XML)
- .when()
- .get("/${punit}/v1/")
- .then()
- .statusCode(HttpStatusCode.OK.getStatusCode())
- .contentType(ContentType.XML)
- .extract()
- .asString();
-
- final XmlPath path = new XmlPath(xml);
- final Collection n = ((Node) ((Node) path.get("service")).get("workspace")).get("collection");
- assertNotNull(n);
- assertFalse(n.isEmpty());
- }
-
- @Test
- public void testRetrieveMetadataDocument() {
- final String xml = given()
- .when()
- .get("/${punit}/v1/$metadata")
- .then()
- .statusCode(HttpStatusCode.OK.getStatusCode())
- .contentType(ContentType.XML)
- .extract()
- .asString();
-
- final XmlPath path = new XmlPath(xml);
- final Node n = ((Node) ((Node) path.get("edmx:Edmx")).get("DataServices")).get("Schema");
- assertNotNull(n);
- assertEquals("${punit}", n.getAttribute("Namespace"));
- assertNotNull(n.get("EntityContainer"));
- }
-
- @Test
- public void testCreateInstance() {
- given()
- .contentType("application/json")
- .body("{ \"Data\" : \"Hello World\" }")
- .when()
- .post("/${punit}/v1/${entity-table}s")
- .then()
- .statusCode(HttpStatusCode.CREATED.getStatusCode());
- given()
- .accept(ContentType.JSON)
- .when()
- .get("/${punit}/v1/${entity-table}s(1)")
- .then()
- .statusCode(HttpStatusCode.OK.getStatusCode());
- }
-
- @Test
- public void testCreateInstanceWithBatch() throws URISyntaxException {
-
- URI uri = getClass().getClassLoader()
- .getResource("requests/CreateEntityViaBatch.txt").toURI();
-
- File myFile = new File(uri);
- final String responce = given()
- .contentType("multipart/mixed;boundary=abc")
- .body(myFile)
- .when()
- .post("/${punit}/v1/$batch")
- .then()
- .statusCode(HttpStatusCode.ACCEPTED.getStatusCode())
- .extract()
- .asString();
-
- given()
- .accept(ContentType.JSON)
- .when()
- .get("/${punit}/v1/${entity-table}s(1)")
- .then()
- .statusCode(HttpStatusCode.OK.getStatusCode());
-
- final String[] partResults = responce.split("--changeset");
- assertTrue(partResults[1].contains("HTTP/1.1 201"));
- assertTrue(partResults[2].contains("HTTP/1.1 400"));
- }
-
- @Test
- public void testCreateInstanceDeep() {
- given()
- .contentType(ContentType.JSON)
- .accept(ContentType.JSON)
- .body("{ \"Data\" : \"Hello World\", \"ValueObjects\" : [{\"Id\" : \"1\"}, {\"Id\" : \"2\"}] }")
- .when()
- .post("/${punit}/v1/${entity-table}s")
- .then()
- .statusCode(HttpStatusCode.CREATED.getStatusCode())
- .body("ValueObjects.Id", hasItems("1", "2"))
- .body("Id", equalTo(1))
- .extract()
- .asString();
- given()
- .accept(ContentType.JSON)
- .when()
- .get("/${punit}/v1/${value-object-table}s(EntityId=1,Id='2')")
- .then()
- .statusCode(HttpStatusCode.OK.getStatusCode());
-
- }
-
- @AfterEach
- public void teardown() {
- RestAssuredMockMvc.reset();
- }
-}
diff --git a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/resources/requests/CreateEntityViaBatch.txt b/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/resources/requests/CreateEntityViaBatch.txt
deleted file mode 100644
index 32aff1745..000000000
--- a/jpa-archetype/odata-jpa-archetype-spring-scp/src/main/resources/archetype-resources/src/test/resources/requests/CreateEntityViaBatch.txt
+++ /dev/null
@@ -1,46 +0,0 @@
---abc
-Content-Type: multipart/mixed; boundary=xyz
-
---xyz
-Content-Type: application/http
-Content-Transfer-Encoding: binary
-Content-Id: 1
-Prefer: return=minimal
-
-POST ${entity-table}s HTTP/1.1
-Accept: application/json
-Content-Type: application/json
-
-{
- "Data": "Hello World",
- "ValueObjects": [
- { "Id": "1" }
- ]
-}
-
-
---xyz--
-
---abc
-Content-Type: multipart/mixed; boundary=xyz2
-
---xyz2
-Content-Type: application/http
-Content-Transfer-Encoding: binary
-Content-Id: 1
-Prefer: return=minimal
-
-POST ${entity-table}s HTTP/1.1
-Accept: application/json
-Content-Type: application/json
-
-{
- "Data": "Batch Test"
- "ValueObjects": [
- { "Id": "1" },
- { "Id": "1" }
- ]
-}
-
---xyz2--
---abc--
\ No newline at end of file
diff --git a/jpa-archetype/odata-jpa-archetype-spring/pom.xml b/jpa-archetype/odata-jpa-archetype-spring/pom.xml
index 1d1f52f96..755f25edd 100644
--- a/jpa-archetype/odata-jpa-archetype-spring/pom.xml
+++ b/jpa-archetype/odata-jpa-archetype-spring/pom.xml
@@ -4,7 +4,7 @@
com.sap.olingoodata-jpa-archetype
- 1.1.1
+ 2.0.0odata-jpa-archetype-springArchetype - odata-jpa-archetype-spring
@@ -17,7 +17,7 @@
org.apache.maven.archetypearchetype-packaging
- 3.1.1
+ 3.2.1
@@ -26,6 +26,9 @@
org.apache.maven.pluginsmaven-archetype-plugin3.2.1
+
+ true
+
diff --git a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/pom.xml b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/pom.xml
index ffc742c14..9b6567b28 100644
--- a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/pom.xml
+++ b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/pom.xml
@@ -1,7 +1,7 @@
-
+
4.0.0${groupId}${artifactId}
@@ -12,15 +12,15 @@
org.springframework.bootspring-boot-starter-parent
- 2.7.6
+ 3.1.3
-
- 1.1.1
- 1.8
- 2.7.9
- 2.2.1
+
+ 2.0.0
+ 17
+ 4.0.2
+ 3.1.0
@@ -37,7 +37,7 @@
junitjunit
-
+
org.springframework.boot
@@ -58,8 +58,8 @@
- org.eclipse.persistence
- javax.persistence
+ jakarta.persistence
+ jakarta.persistence-api${jpa.version}compile
@@ -73,37 +73,37 @@
odata-jpa-processor${processor.version}
-
- com.sap.olingo
- odata-jpa-processor-cb
- ${processor.version}
-
+
+ com.sap.olingo
+ odata-jpa-processor-cb
+ ${processor.version}
+ com.sap.olingoodata-jpa-spring-support${processor.version}
-
+
org.springframework.bootspring-boot-configuration-processortrue
+
+ com.h2database
+ h2
+ 2.2.222
+ runtime
+ org.flywaydbflyway-core
- 8.4.0
-
-
- com.h2database
- h2
- 2.2.222
- runtime
-
-
- org.hsqldb
- hsqldb
- runtime
-
+ 9.22.0
+
+
+ org.hsqldb
+ hsqldb
+ runtime
+ org.springframework.bootspring-boot-devtools
@@ -125,7 +125,7 @@
junit-platform-launcher1.9.1test
-
+
diff --git a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/config/EclipseLinkJpaConfiguration.java b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/config/EclipseLinkJpaConfiguration.java
index 43a6aa5c9..083f2ab13 100644
--- a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/config/EclipseLinkJpaConfiguration.java
+++ b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/config/EclipseLinkJpaConfiguration.java
@@ -8,6 +8,7 @@
import static org.eclipse.persistence.config.PersistenceUnitProperties.WEAVING;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
@@ -15,17 +16,18 @@
import org.eclipse.persistence.logging.SessionLog;
import ${package}.model.EntityTemplate;
import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
-import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
+import org.springframework.orm.jpa.persistenceunit.PersistenceManagedTypes;
import org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter;
import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter;
import org.springframework.transaction.jta.JtaTransactionManager;
+import org.springframework.util.ObjectUtils;
+import org.springframework.util.StringUtils;
@Configuration
public class EclipseLinkJpaConfiguration extends JpaBaseConfiguration {
@@ -59,15 +61,22 @@ protected Map getVendorProperties() {
return jpaProperties;
}
- @Bean
- public LocalContainerEntityManagerFactoryBean customerEntityManagerFactory(
- final EntityManagerFactoryBuilder builder, @Autowired final DataSource ds) {
-
- return builder
- .dataSource(ds)
+ @Override
+ public LocalContainerEntityManagerFactoryBean entityManagerFactory(EntityManagerFactoryBuilder factoryBuilder,
+ PersistenceManagedTypes persistenceManagedTypes) {
+ Map vendorProperties = getVendorProperties();
+ customizeVendorProperties(vendorProperties);
+ return factoryBuilder
+ .dataSource(this.getDataSource())
+ .properties(vendorProperties)
+ .mappingResources(getMapping())
.packages(EntityTemplate.class)
- .properties(getVendorProperties())
.jta(false)
.build();
}
+
+ private String[] getMapping() {
+ List mappingResources = this.getProperties().getMappingResources();
+ return (!ObjectUtils.isEmpty(mappingResources) ? StringUtils.toStringArray(mappingResources) : null);
+ }
}
\ No newline at end of file
diff --git a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/config/ProcessorConfiguration.java b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/config/ProcessorConfiguration.java
index 0b11836d2..c37bc7ace 100644
--- a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/config/ProcessorConfiguration.java
+++ b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/config/ProcessorConfiguration.java
@@ -2,7 +2,7 @@
import static org.springframework.web.context.WebApplicationContext.SCOPE_REQUEST;
-import javax.persistence.EntityManagerFactory;
+import jakarta.persistence.EntityManagerFactory;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.server.api.debug.DefaultDebugSupport;
diff --git a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/controller/ODataController.java b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/controller/ODataController.java
index 1c3940666..35c78caa2 100644
--- a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/controller/ODataController.java
+++ b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/controller/ODataController.java
@@ -1,7 +1,7 @@
package ${package}.controller;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.olingo.commons.api.ex.ODataException;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/EntityTemplate.java b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/EntityTemplate.java
index 4f1d7acea..c08b9dee3 100644
--- a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/EntityTemplate.java
+++ b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/EntityTemplate.java
@@ -3,16 +3,16 @@
import java.util.ArrayList;
import java.util.Collection;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.OneToMany;
-import javax.persistence.SequenceGenerator;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.SequenceGenerator;
+import jakarta.persistence.Table;
@Entity(name = "${entity-table}")
@Table(schema = "\"${schema}\"", name = "\"${entity-table}\"")
diff --git a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplate.java b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplate.java
index 2f0d3ac4b..c9e03f9d8 100644
--- a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplate.java
+++ b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplate.java
@@ -1,13 +1,13 @@
package ${package}.model;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Id;
-import javax.persistence.IdClass;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Id;
+import jakarta.persistence.IdClass;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
@IdClass(ValueObjectTemplateKey.class)
@Entity(name = "${value-object-table}")
diff --git a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplateKey.java b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplateKey.java
index 8090c1e6c..8df40eaa1 100644
--- a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplateKey.java
+++ b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/java/model/ValueObjectTemplateKey.java
@@ -2,7 +2,7 @@
import java.io.Serializable;
-import javax.persistence.Id;
+import jakarta.persistence.Id;
public class ValueObjectTemplateKey implements Serializable {
diff --git a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/resources/application-test.yml b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/resources/application-test.yml
index 2031fcdd8..ca3706a28 100644
--- a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/resources/application-test.yml
+++ b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/main/resources/application-test.yml
@@ -5,7 +5,7 @@ logging:
com:
sap:
olingo:
- jpa: INFO
+ jpa: TRACE
odata:
jpa:
punit_name: ${punit}
diff --git a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/test/java/integrationtest/ControllerTest.java b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/test/java/integrationtest/ControllerTest.java
index b32b6af00..68fc27e45 100644
--- a/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/test/java/integrationtest/ControllerTest.java
+++ b/jpa-archetype/odata-jpa-archetype-spring/src/main/resources/archetype-resources/src/test/java/integrationtest/ControllerTest.java
@@ -21,7 +21,6 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.web.context.WebApplicationContext;
@@ -38,8 +37,6 @@ class ControllerTest {
@Autowired
private WebApplicationContext context;
- @LocalServerPort
- private int port;
@BeforeEach
void setup() {
diff --git a/jpa-archetype/pom.xml b/jpa-archetype/pom.xml
index 700a4eee4..fca039962 100644
--- a/jpa-archetype/pom.xml
+++ b/jpa-archetype/pom.xml
@@ -4,18 +4,17 @@
4.0.0com.sap.olingoodata-jpa-archetype
- 1.1.1
+ 2.0.0pomhttps://github.com/SAP/olingo-jpa-processor-v4UTF-8
- 1.8
- 1.1.1
+ 17
+ 2.0.0odata-jpa-archetype-spring
- odata-jpa-archetype-spring-scp
\ No newline at end of file
diff --git a/jpa-tutorial/QuickStart/QuickStart.adoc b/jpa-tutorial/QuickStart/QuickStart.adoc
index 06d997b39..a8ae653aa 100644
--- a/jpa-tutorial/QuickStart/QuickStart.adoc
+++ b/jpa-tutorial/QuickStart/QuickStart.adoc
@@ -17,7 +17,7 @@ In order to follow this tutorial, you should have
In order to perform the tutorial you need:
-* A Java JDK 1.8 or higher
+* A Java JDK 17 or higher
* A Eclipse IDE for Java EE, or another one that provides the same functionality
* Optional: Maven separately installed, to perform Maven commands in case the JPA Processor projects should not be imported into your IDE
* Optional: Git separately installed.
@@ -46,7 +46,7 @@ This should contain the information about archetype:
com.sap.olingoodata-jpa-archetype-spring
- 1.0.9
+ 2.0.0
@@ -70,17 +70,17 @@ image:../images/quick-start/MavenSelectArchetype.png[Maven Select Archetype, 500
As a last step some parameter have to be provided:
-[options="header"]
-|===
-|Parameter Name |Value
-//-------------
+[options="header"]
+|===
+|Parameter Name |Value
+//-------------
|Group Id|com.example
|Artifact Id|trippin
|punit|Trippin
|schema|Trippin
|entity-table|Person
-|value-object-table|Trip
-|===
+|value-object-table|Trip
+|===
image:../images/quick-start/MavenSetParameterArchetype.png[Set parameter archetype, 500]
@@ -144,7 +144,7 @@ The other JPA Processor dependencies are **optional**:
=== Configuration
JPA Processor need to be customized to work properly. Package `com.example.trippin.config` contains two classes that provide this information. The first is `EclipseLinkJpaConfiguration`,
-which is needed to make use of http://www.eclipse.org/eclipselink/[Eclipselink]. For our service the most important part is in method `customerEntityManagerFactory`. Here we provide with `.packages(EntityTemplate.class)` a reference to a package that contains the JPA entities and so defines our persistence-unit.
+which is needed to make use of http://www.eclipse.org/eclipselink/[Eclipselink]. For our service the most important part is in method `entityManagerFactory`. Here we provide with `.packages(EntityTemplate.class)` a reference to a package that contains the JPA entities and so defines our persistence-unit.
The second one is `ProcessorConfiguration`. It has two methods. The first one creates a service context, which should be valid for the live time of the service:
@@ -169,8 +169,8 @@ public JPAODataSessionContextAccess sessionContext(@Autowired final EntityManage
<3> The _RequestMappingPath_ is needed by Olingo in case a service uses Spring.
-[NOTE]
-====
+[NOTE]
+====
The namepsace can be found in the metadata, after executing http://localhost:9010/Trippin/v1/$metadata:
[source,xml]
----
@@ -186,8 +186,8 @@ The namepsace can be found in the metadata, after executing http://localhost:901
[NOTE]
====
-The persistence-unit name is injected from the `application.yml` that is located in `/src/main/resources/`.
-
+The persistence-unit name is injected from the `application.yml` that is located in `/src/main/resources/`.
+
====
The second one is the creation of a request context, which is created for each request:
diff --git a/jpa/.settings/org.eclipse.jdt.core.prefs b/jpa/.settings/org.eclipse.jdt.core.prefs
index 070014fbf..01a729cd2 100644
--- a/jpa/.settings/org.eclipse.jdt.core.prefs
+++ b/jpa/.settings/org.eclipse.jdt.core.prefs
@@ -17,8 +17,6 @@ org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.APILeak=warning
-org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
diff --git a/jpa/odata-jpa-annotation/.gitignore b/jpa/odata-jpa-annotation/.gitignore
index 3b248b28a..bcb74aa8a 100644
--- a/jpa/odata-jpa-annotation/.gitignore
+++ b/jpa/odata-jpa-annotation/.gitignore
@@ -4,7 +4,4 @@ target/
# JDT-specific (Eclipse Java Development Tools)
.classpath
-# --- EclipseIDE stuff START
-.settings/
-.metadata
/.sts4-cache/
diff --git a/jpa/odata-jpa-annotation/.settings/org.eclipse.jdt.core.prefs b/jpa/odata-jpa-annotation/.settings/org.eclipse.jdt.core.prefs
index a9e7a4212..94ac14d17 100644
--- a/jpa/odata-jpa-annotation/.settings/org.eclipse.jdt.core.prefs
+++ b/jpa/odata-jpa-annotation/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
@@ -9,4 +9,4 @@ org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.source=17
diff --git a/jpa/odata-jpa-annotation/.settings/org.eclipse.wst.common.project.facet.core.xml b/jpa/odata-jpa-annotation/.settings/org.eclipse.wst.common.project.facet.core.xml
index ee260d978..babef879f 100644
--- a/jpa/odata-jpa-annotation/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ b/jpa/odata-jpa-annotation/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/jpa/odata-jpa-annotation/pom.xml b/jpa/odata-jpa-annotation/pom.xml
index f574b4b1b..9f208e5c9 100644
--- a/jpa/odata-jpa-annotation/pom.xml
+++ b/jpa/odata-jpa-annotation/pom.xml
@@ -7,7 +7,7 @@
com.sap.olingoodata-jpa
- 1.1.1
+ 2.0.0odata-jpa-annotationodata-jpa-annotation
@@ -20,8 +20,8 @@
${odata.version}
- org.eclipse.persistence
- javax.persistence
+ jakarta.persistence
+ jakarta.persistence-api${jpa.version}
@@ -33,19 +33,19 @@
org.junit.jupiterjunit-jupiter
- 5.9.1
+ ${junit.version}testorg.junit.platformjunit-platform-launcher
- 1.9.1
+ ${junit-platform.version}testorg.mockitomockito-core
- 3.6.0
+ ${mockito.version}test
diff --git a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/converter/OffsetDateTimeConverter.java b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/converter/OffsetDateTimeConverter.java
index e72140125..f4c8a5235 100644
--- a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/converter/OffsetDateTimeConverter.java
+++ b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/converter/OffsetDateTimeConverter.java
@@ -3,8 +3,8 @@
import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
-import javax.persistence.AttributeConverter;
-import javax.persistence.Converter;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
/**
* Default converter to convert from {@link java.time.OffsetDateTime} to {@link java.time.ZonedDateTime}. This is
diff --git a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/converter/TimeInstantLongConverter.java b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/converter/TimeInstantLongConverter.java
index 54ee93415..130764507 100644
--- a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/converter/TimeInstantLongConverter.java
+++ b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/converter/TimeInstantLongConverter.java
@@ -2,8 +2,8 @@
import java.time.Instant;
-import javax.persistence.AttributeConverter;
-import javax.persistence.Converter;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
/**
* Default converter to convert from {@link Long} to {@link java.time.Instant}.
diff --git a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmAsEntitySet.java b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmAsEntitySet.java
deleted file mode 100644
index 9aac176fa..000000000
--- a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmAsEntitySet.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.sap.olingo.jpa.metadata.core.edm.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Allows to mark an jpa entity as an additional entity set of another entity type.
- * This is only allowed for leafs in an inheritance hierarchy. The jpa entity must not have own columns
- * OData Version 4.0 Part 3 - 13 Entity Container Example 30
- * @deprecated (since 1.0.3, replace with {@link EdmEntityType}, deleted with 1.1.0 )
- */
-@Deprecated
-@Target({ ElementType.TYPE })
-@Retention(value = RetentionPolicy.RUNTIME)
-public @interface EdmAsEntitySet {
-
-}
diff --git a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEntityType.java b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEntityType.java
index ec3fe978b..02b1ba26a 100644
--- a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEntityType.java
+++ b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEntityType.java
@@ -28,11 +28,11 @@
/**
* Query Extension Provider provides a set to methods to extend or influence the generated query. This may be from
- * interest in case a subset of records shall be represented by an Entity Set or Singleton and it is not possible to
+ * interest in case a subset of records shall be represented by an Entity Set or Singleton and it is not possible to
* use a database view.
*
*
- * Query Extension Provider are inherited. One that is given at a sub type overrides one that is given at the super
+ * Query Extension Provider are inherited. One that is given at a sub type overrides one that is given at the super
* type or base type.
*/
Class extends EdmQueryExtensionProvider> extensionProvider() default EdmQueryExtensionProvider.class;
diff --git a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEnumeration.java b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEnumeration.java
index 220d53d95..e4b84f63d 100644
--- a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEnumeration.java
+++ b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEnumeration.java
@@ -6,13 +6,14 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-import javax.persistence.AttributeConverter;
-import javax.persistence.Enumerated;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Enumerated;
/**
* Annotation to tag Java enumerations that shall be provided via an OData service. For details about OData Enumerations
* see: 10
+ * href=
+ * "http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part3-csdl/odata-v4.0-errata03-os-part3-csdl-complete.html#_Toc453752565">10
* Enumeration Type.
* The following conversion rule have been established:
*
diff --git a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmQueryExtensionProvider.java b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmQueryExtensionProvider.java
index e14704305..a955f05f4 100644
--- a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmQueryExtensionProvider.java
+++ b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmQueryExtensionProvider.java
@@ -4,15 +4,18 @@
package com.sap.olingo.jpa.metadata.core.edm.annotation;
import javax.annotation.CheckForNull;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Expression;
-import javax.persistence.criteria.From;
+
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Expression;
+import jakarta.persistence.criteria.From;
/**
- * Provides a set to methods to extend or influence the generated query.
+ * Provides a set to methods to extend or influence the generated query.
+ *
*
* An instance of the extension provider is created once per OData request. That is, it could be created multiple times
- * per http request in case of $batch requests.
+ * per http request in case of $batch requests.
+ *
* An implementing class may provide one constructor having no parameter or a combination of the following:
*
*
All header: com.sap.olingo.jpa.metadata.api.JPAHttpHeaderMap
diff --git a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransient.java b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransient.java
index f0e7ca904..31f25c7ec 100644
--- a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransient.java
+++ b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransient.java
@@ -9,8 +9,6 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-import javax.persistence.Transient;
-
/**
* The annotation marks attributes that are transient, but shall be part of the Edm.
* Please note that the attribute needs the corresponding JPA annotation {@link Transient} as well.
@@ -23,7 +21,9 @@
public @interface EdmTransient {
/**
* Optional: An array of path to attributes that need to be present to build the annotated one. In case the path
- * is composed, path segments joined together by forward slashes (/) e.g address/cityName.
The correctness
+ * is composed, path segments joined together by forward slashes (/) e.g address/cityName.
+ *
+ * The correctness
* of the path is check when the entity type is build.
*/
String[] requiredAttributes() default {};
diff --git a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransientPropertyCalculator.java b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransientPropertyCalculator.java
index bec661383..b98a62f21 100644
--- a/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransientPropertyCalculator.java
+++ b/jpa/odata-jpa-annotation/src/main/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransientPropertyCalculator.java
@@ -8,24 +8,29 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import javax.persistence.Tuple;
+
+import jakarta.persistence.Tuple;
/**
- * Transient property converter.
+ * Transient property converter.
+ *
* A converter take a row returned from the database and calculates, based on its values, either one additional value or
* a collection of values.
- * The converter is mentioned in the {@link EdmTransient} annotation at a POJO attribute. E.g.:
+ * The converter is mentioned in the {@link EdmTransient} annotation at a POJO attribute. E.g.:
+ *
*
* An instance of the converter is created once per OData request. That is, it could be created multiple times per http
- * request in case of $batch requests.
+ * request in case of $batch requests.
+ *
* An implementing class may provide one constructor having no parameter or a combination of the following:
*
- *
An Entity Manager: javax.persistence.EntityManager
+ *
An Entity Manager: jakarta.persistence.EntityManager
*
All header: com.sap.olingo.jpa.metadata.api.JPAHttpHeaderMap
*
Access to own request parameter: com.sap.olingo.jpa.metadata.api.JPARequestParameterMap
*
diff --git a/jpa/odata-jpa-annotation/src/test/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEnumerationTest.java b/jpa/odata-jpa-annotation/src/test/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEnumerationTest.java
index a18f26c87..24280a19c 100644
--- a/jpa/odata-jpa-annotation/src/test/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEnumerationTest.java
+++ b/jpa/odata-jpa-annotation/src/test/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmEnumerationTest.java
@@ -6,13 +6,13 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
-import javax.persistence.AttributeConverter;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import jakarta.persistence.AttributeConverter;
+
/**
- * @author Oliver Grande
+ * @author Oliver Grande
* @since 1.0.9
* 18.01.2022
*/
diff --git a/jpa/odata-jpa-annotation/src/test/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransientPropertyCalculatorTest.java b/jpa/odata-jpa-annotation/src/test/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransientPropertyCalculatorTest.java
index dbf4eec43..0149cd61a 100644
--- a/jpa/odata-jpa-annotation/src/test/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransientPropertyCalculatorTest.java
+++ b/jpa/odata-jpa-annotation/src/test/java/com/sap/olingo/jpa/metadata/core/edm/annotation/EdmTransientPropertyCalculatorTest.java
@@ -8,13 +8,13 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
-import javax.persistence.Tuple;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import jakarta.persistence.Tuple;
+
/**
- * @author Oliver Grande
+ * @author Oliver Grande
* @since 1.0.9
* 18.01.2022
*/
diff --git a/jpa/odata-jpa-coverage/pom.xml b/jpa/odata-jpa-coverage/pom.xml
index bdcdb6a2a..5e831a852 100644
--- a/jpa/odata-jpa-coverage/pom.xml
+++ b/jpa/odata-jpa-coverage/pom.xml
@@ -4,7 +4,7 @@
com.sap.olingoodata-jpa
- 1.1.1
+ 2.0.0odata-jpa-coverage
@@ -60,7 +60,7 @@
com.sap.olingoodata-jpa-vocabularies${project.version}
-
+
diff --git a/jpa/odata-jpa-metadata/.settings/org.eclipse.jdt.core.prefs b/jpa/odata-jpa-metadata/.settings/org.eclipse.jdt.core.prefs
index 9b48fdc3d..acf518c14 100644
--- a/jpa/odata-jpa-metadata/.settings/org.eclipse.jdt.core.prefs
+++ b/jpa/odata-jpa-metadata/.settings/org.eclipse.jdt.core.prefs
@@ -1,9 +1,9 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.source=17
diff --git a/jpa/odata-jpa-metadata/.settings/org.eclipse.wst.common.project.facet.core.xml b/jpa/odata-jpa-metadata/.settings/org.eclipse.wst.common.project.facet.core.xml
index ee260d978..babef879f 100644
--- a/jpa/odata-jpa-metadata/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ b/jpa/odata-jpa-metadata/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/jpa/odata-jpa-metadata/pom.xml b/jpa/odata-jpa-metadata/pom.xml
index 8a10f23f2..6b291ab0e 100644
--- a/jpa/odata-jpa-metadata/pom.xml
+++ b/jpa/odata-jpa-metadata/pom.xml
@@ -7,7 +7,7 @@
com.sap.olingoodata-jpa
- 1.1.1
+ 2.0.0odata-jpa-metadata
@@ -36,8 +36,8 @@
${project.version}
- org.eclipse.persistence
- javax.persistence
+ jakarta.persistence
+ jakarta.persistence-api${jpa.version}
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEdmMetadataPostProcessor.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEdmMetadataPostProcessor.java
index b29b7f4dc..17228fb5d 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEdmMetadataPostProcessor.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEdmMetadataPostProcessor.java
@@ -9,18 +9,17 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.IntermediateReferenceList;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.IntermediateSingletonAccess;
-public abstract class JPAEdmMetadataPostProcessor {
+public interface JPAEdmMetadataPostProcessor {
+ public default void processEntityContainer(final IntermediateEntityContainerAccess container) {}
- public void processEntityContainer(final IntermediateEntityContainerAccess container) {}
+ public default void processEntityType(final IntermediateEntityTypeAccess entityType){}
- public abstract void processEntityType(final IntermediateEntityTypeAccess entityType);
+ public default void processEntitySet(final IntermediateEntitySetAccess entitySet) {}
- public void processEntitySet(final IntermediateEntitySetAccess entitySet) {}
+ public default void processSingleton(final IntermediateSingletonAccess singleton) {}
- public void processSingleton(final IntermediateSingletonAccess singleton) {}
-
- public abstract void processNavigationProperty(final IntermediateNavigationPropertyAccess property,
- final String jpaManagedTypeClassName);
+ public default void processNavigationProperty(final IntermediateNavigationPropertyAccess property,
+ final String jpaManagedTypeClassName){}
/**
*
@@ -28,12 +27,12 @@ public abstract void processNavigationProperty(final IntermediateNavigationPrope
* @param jpaManagedTypeClassName
* @return
*/
- public abstract void processProperty(final IntermediatePropertyAccess property, final String jpaManagedTypeClassName);
+ public default void processProperty(final IntermediatePropertyAccess property, final String jpaManagedTypeClassName){}
/**
* Option to provide references to external CSDL documents. The document must be an XML document
* @param references List of refernces to external CSDL documents.
* @throws ODataJPAModelException
*/
- public abstract void provideReferences(final IntermediateReferenceList references) throws ODataJPAModelException;
+ public default void provideReferences(final IntermediateReferenceList references) throws ODataJPAModelException{}
}
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEdmProvider.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEdmProvider.java
index ad32722bd..2433b7480 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEdmProvider.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEdmProvider.java
@@ -7,8 +7,6 @@
import java.util.Objects;
import javax.annotation.Nonnull;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.metamodel.Metamodel;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider;
@@ -37,6 +35,9 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.impl.JPADefaultEdmNameBuilder;
import com.sap.olingo.jpa.metadata.core.edm.mapper.impl.JPAServiceDocumentFactory;
+import jakarta.persistence.EntityManagerFactory;
+import jakarta.persistence.metamodel.Metamodel;
+
public class JPAEdmProvider extends CsdlAbstractEdmProvider {
private final JPAEdmNameBuilder nameBuilder;
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEntityManagerFactory.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEntityManagerFactory.java
index 50f23c3b1..fee0dc3d0 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEntityManagerFactory.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAEntityManagerFactory.java
@@ -3,12 +3,13 @@
import java.util.HashMap;
import java.util.Map;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
import javax.sql.DataSource;
+import jakarta.persistence.EntityManagerFactory;
+import jakarta.persistence.Persistence;
+
public class JPAEntityManagerFactory {
- private static final String ENTITY_MANAGER_DATA_SOURCE = "javax.persistence.nonJtaDataSource";
+ private static final String ENTITY_MANAGER_DATA_SOURCE = "jakarta.persistence.nonJtaDataSource";
private static Map> emfMap;
private JPAEntityManagerFactory() {
@@ -22,7 +23,7 @@ public static EntityManagerFactory getEntityManagerFactory(final String pUnit, f
if (emfMap == null) {
emfMap = new HashMap<>();
}
- Integer dsKey = ds.hashCode();
+ final Integer dsKey = ds.hashCode();
if (emfMap.containsKey(pUnit)) {
final Map dsMap = emfMap.get(pUnit);
EntityManagerFactory emf = dsMap.get(dsKey);
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAJoinColumn.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAJoinColumn.java
index c1e6877d7..2a7ad07fc 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAJoinColumn.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAJoinColumn.java
@@ -8,7 +8,7 @@
* Created: 02.02.2020
*
*/
-public interface JPAJoinColumn {
+public interface JPAJoinColumn {
/**
* Returns the name of the column of the target table. This can be different from the name given in the @JoinColumn
* annotation.
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAODataQueryContext.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAODataQueryContext.java
index 4a193682f..42341bfc2 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAODataQueryContext.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/api/JPAODataQueryContext.java
@@ -1,10 +1,10 @@
package com.sap.olingo.jpa.metadata.api;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.From;
-
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.From;
+
public interface JPAODataQueryContext {
CriteriaBuilder getCriteriaBuilder();
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/api/JPAAttribute.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/api/JPAAttribute.java
index 45836ce5a..8e7f3b13d 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/api/JPAAttribute.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/api/JPAAttribute.java
@@ -5,7 +5,6 @@
import java.util.Set;
import javax.annotation.CheckForNull;
-import javax.persistence.AttributeConverter;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
@@ -13,6 +12,8 @@
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmTransientPropertyCalculator;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.AttributeConverter;
+
public interface JPAAttribute extends JPAElement, JPAAnnotatable {
/**
* Returns an instance of the converter defined at the attribute, in case an explicit conversion is required. That is,
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/api/JPAEdmNameBuilder.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/api/JPAEdmNameBuilder.java
index 9964267be..992feed22 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/api/JPAEdmNameBuilder.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/api/JPAEdmNameBuilder.java
@@ -4,9 +4,10 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.api;
import javax.annotation.Nonnull;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.EmbeddableType;
-import javax.persistence.metamodel.EntityType;
+
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.EmbeddableType;
+import jakarta.persistence.metamodel.EntityType;
import org.apache.olingo.commons.api.edm.provider.CsdlEntityType;
@@ -29,7 +30,8 @@ public interface JPAEdmNameBuilder {
/**
* Container names are
+ * href=
+ * "http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_SimpleIdentifier">
* Simple Identifier,
* so can contain only letters, digits and underscores.
* @return non empty unique name of an Entity Set
@@ -39,7 +41,8 @@ public interface JPAEdmNameBuilder {
/**
* Create a name of an
+ * href=
+ * "http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_12.2_The_edm:EntitySet">
* Entity Set derived from the name of the corresponding entity type.
* @param entityTypeName
* @return non empty unique name of an Entity Set
@@ -53,7 +56,8 @@ default String buildEntitySetName(final CsdlEntityType entityType) {
/**
* Create a name of an
+ * href=
+ * "http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406398032">
* Singleton derived from the name of the corresponding entity type.
* @param entityTypeName
* @return non empty unique name of a Singleton
@@ -69,7 +73,8 @@ default String buildSingletonName(final CsdlEntityType entityType) {
/**
* Creates the name of an Entity
+ * href=
+ * "http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397976">Entity
* Type derived from JPA Entity Type.
* @param jpaEntityType
* @return non empty unique name of an Entity Type
@@ -79,7 +84,8 @@ default String buildSingletonName(final CsdlEntityType entityType) {
/**
* Converts the internal java class name of an enumeration into the external entity data model
+ * href=
+ * "http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397991">
* Enumeration Type name.
* @param javaEnum
* @return non empty unique name of an Enumeration
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/extension/ODataAction.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/extension/ODataAction.java
index f52fd8e58..eda0565bd 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/extension/ODataAction.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/extension/ODataAction.java
@@ -7,7 +7,7 @@
*
* An implementing class may provide one constructor having no parameter or a combination of the following:
*
- *
An Entity Manager: javax.persistence.EntityManager
+ *
An Entity Manager: jakarta.persistence.EntityManager
*
All header: com.sap.olingo.jpa.metadata.api.JPAHttpHeaderMap
*
Access to own request parameter: com.sap.olingo.jpa.metadata.api.JPARequestParameterMap
* An implementing class may provide one constructor having no parameter or a combination of the following:
*
- *
An Entity Manager: javax.persistence.EntityManager
+ *
An Entity Manager: jakarta.persistence.EntityManager
*
All header: com.sap.olingo.jpa.metadata.api.JPAHttpHeaderMap
*
Access to own request parameter: com.sap.olingo.jpa.metadata.api.JPARequestParameterMap
*
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/DefaultEdmPostProcessor.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/DefaultEdmPostProcessor.java
index b82bd257a..4bafd6a62 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/DefaultEdmPostProcessor.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/DefaultEdmPostProcessor.java
@@ -6,7 +6,7 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.IntermediatePropertyAccess;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.IntermediateReferenceList;
-final class DefaultEdmPostProcessor extends JPAEdmMetadataPostProcessor {
+final class DefaultEdmPostProcessor implements JPAEdmMetadataPostProcessor{
@Override
public void processNavigationProperty(final IntermediateNavigationPropertyAccess property,
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateActionFactory.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateActionFactory.java
index e1b408783..7dee39b99 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateActionFactory.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateActionFactory.java
@@ -15,10 +15,10 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.ODataAction;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.ODataOperation;
-class IntermediateActionFactory extends IntermediateOperationFactory {
+class IntermediateActionFactory implements IntermediateOperationFactory {
//Description
@Override
- IntermediateJavaAction createOperation(final JPAEdmNameBuilder nameBuilder, final IntermediateSchema schema,
+ public IntermediateJavaAction createOperation(final JPAEdmNameBuilder nameBuilder, final IntermediateSchema schema,
final Method method, final Object functionDescription)
throws ODataJPAModelException {
return new IntermediateJavaAction(nameBuilder, (EdmAction) functionDescription, method, schema);
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateCollectionProperty.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateCollectionProperty.java
index 66e954982..74829f66d 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateCollectionProperty.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateCollectionProperty.java
@@ -3,18 +3,11 @@
import static com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys.NOT_SUPPORTED_NO_IMPLICIT_COLUMNS;
import static com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys.NOT_SUPPORTED_NO_IMPLICIT_COLUMNS_COMPLEX;
import static com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys.NOT_SUPPORTED_PROTECTED_COLLECTION;
-import static javax.persistence.metamodel.Type.PersistenceType.EMBEDDABLE;
+import static jakarta.persistence.metamodel.Type.PersistenceType.EMBEDDABLE;
import java.lang.reflect.AnnotatedElement;
import java.util.ArrayList;
import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.persistence.CollectionTable;
-import javax.persistence.JoinColumn;
-import javax.persistence.metamodel.PluralAttribute;
-import javax.persistence.metamodel.Type;
-import javax.persistence.metamodel.Type.PersistenceType;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
@@ -33,6 +26,12 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys;
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.metamodel.PluralAttribute;
+import jakarta.persistence.metamodel.Type;
+import jakarta.persistence.metamodel.Type.PersistenceType;
+
/**
* Represents a collection property. That is a property that may occur more than once.
*
@@ -212,8 +211,8 @@ String getDefaultValue() throws ODataJPAModelException {
JPAJoinTable getJoinTable() throws ODataJPAModelException {
if (joinTable == null) {
- final javax.persistence.CollectionTable jpaJoinTable = ((AnnotatedElement) this.jpaAttribute.getJavaMember())
- .getAnnotation(javax.persistence.CollectionTable.class);
+ final jakarta.persistence.CollectionTable jpaJoinTable = ((AnnotatedElement) this.jpaAttribute.getJavaMember())
+ .getAnnotation(jakarta.persistence.CollectionTable.class);
joinTable = jpaJoinTable != null ? new IntermediateCollectionTable(jpaJoinTable, schema) : null;
}
return joinTable;
@@ -330,14 +329,14 @@ else if (!(contextType instanceof IntermediateEntityType))
public List getRightColumnsList() throws ODataJPAModelException {
return getJoinColumns().stream()
.map(JPAOnConditionItem::getRightPath)
- .collect(Collectors.toList());
+ .toList();
}
@Override
public List getLeftColumnsList() throws ODataJPAModelException {
return getJoinColumns().stream()
.map(JPAOnConditionItem::getLeftPath)
- .collect(Collectors.toList());
+ .toList();
}
}
}
\ No newline at end of file
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateComplexType.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateComplexType.java
index dd2b3cb7d..8be651374 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateComplexType.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateComplexType.java
@@ -1,7 +1,5 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
-import javax.persistence.metamodel.EmbeddableType;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.olingo.commons.api.edm.provider.CsdlComplexType;
@@ -9,6 +7,8 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEdmNameBuilder;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.metamodel.EmbeddableType;
+
/**
* Complex Types are used to structure Entity Types by grouping properties that belong together. Complex Types can
* contain of
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateDescriptionProperty.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateDescriptionProperty.java
index f80993248..b749b4533 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateDescriptionProperty.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateDescriptionProperty.java
@@ -11,10 +11,6 @@
import java.util.Map;
import java.util.Optional;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.metamodel.Attribute;
-
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmDescriptionAssociation;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmDescriptionAssociation.valueAssignment;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationAttribute;
@@ -30,6 +26,10 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinColumns;
+import jakarta.persistence.metamodel.Attribute;
+
final class IntermediateDescriptionProperty extends IntermediateSimpleProperty implements JPADescriptionAttribute,
JPAAssociationAttribute {
private IntermediateSimpleProperty descriptionProperty;
@@ -87,9 +87,8 @@ protected synchronized void lazyBuildEdmItem() throws ODataJPAModelException {
if (this.edmProperty == null) {
super.lazyBuildEdmItem();
- if (jpaMember instanceof AnnotatedElement) {
- final EdmDescriptionAssociation association = ((AnnotatedElement) jpaMember).getAnnotation(
- EdmDescriptionAssociation.class);
+ if (jpaMember instanceof final AnnotatedElement annotatedElement) {
+ final EdmDescriptionAssociation association = annotatedElement.getAnnotation(EdmDescriptionAssociation.class);
if (association != null) {
// determine generic type of a collection in case of an OneToMany association
determineTargetEntityType(jpaMember);
@@ -129,8 +128,7 @@ private void checkConsistencyOfLocalInfo(final String languageAttribute) throws
}
private void determineTargetEntityType(final Member jpaMember) {
- if (jpaMember instanceof Field) {
- final Field jpaField = (Field) jpaMember;
+ if (jpaMember instanceof final Field jpaField) {
final ParameterizedType jpaTargetEntityType = (ParameterizedType) jpaField.getGenericType();
if (jpaTargetEntityType != null)
targetEntity = schema.getEntityType((Class>) jpaTargetEntityType.getActualTypeArguments()[0]);
@@ -158,9 +156,9 @@ private JPAPath convertAttributeToPath(final String attribute) throws ODataJPAMo
}
return new JPAPathImpl(nextHop.getExternalName(), nextHop.getDBFieldName(), targetPath);
} else {
- final IntermediateSimpleProperty p = (IntermediateSimpleProperty) targetEntity.getAttribute(attribute)
+ final IntermediateSimpleProperty property = (IntermediateSimpleProperty) targetEntity.getAttribute(attribute)
.orElseThrow(() -> new ODataJPAModelException(MessageKeys.PATH_ELEMENT_NOT_FOUND, pathItems[0], attribute));
- return new JPAPathImpl(p.getExternalName(), p.getDBFieldName(), p);
+ return new JPAPathImpl(property.getExternalName(), property.getDBFieldName(), property);
}
}
@@ -278,9 +276,9 @@ private List buildJoinColumnsFromAnnotations(final boole
if (columns != null) {
for (final JoinColumn column : columns) {
final IntermediateJoinColumn intermediateColumn = new IntermediateJoinColumn(column);
- final String refColumnName = intermediateColumn.getReferencedColumnName();
+ final String referencedColumnName = intermediateColumn.getReferencedColumnName();
final String name = intermediateColumn.getName();
- if (refColumnName == null || refColumnName.isEmpty() || name == null || name.isEmpty()) {
+ if (referencedColumnName == null || referencedColumnName.isEmpty() || name == null || name.isEmpty()) {
implicitColumns += 1;
if (implicitColumns > 1)
throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.NOT_SUPPORTED_NO_IMPLICIT_COLUMNS,
@@ -303,10 +301,10 @@ private List buildJoinColumnsFromAnnotations(final boole
private void fillMissingName(final boolean isSourceOne, final IntermediateJoinColumn intermediateColumn)
throws ODataJPAModelException {
- final String refColumnName = intermediateColumn.getReferencedColumnName();
+ final String referencedColumnName = intermediateColumn.getReferencedColumnName();
final String name = intermediateColumn.getName();
- if (isSourceOne && (emptyString(refColumnName)))
+ if (isSourceOne && (emptyString(referencedColumnName)))
intermediateColumn.setReferencedColumnName(
((IntermediateSimpleProperty) ((IntermediateEntityType>) sourceType)
.getKey().get(0)).getDBFieldName());
@@ -314,7 +312,7 @@ else if (isSourceOne && (emptyString(name)))
intermediateColumn.setReferencedColumnName(
((IntermediateSimpleProperty) ((IntermediateEntityType>) targetEntity)
.getKey().get(0)).getDBFieldName());
- else if (!isSourceOne && (emptyString(refColumnName)))
+ else if (!isSourceOne && (emptyString(referencedColumnName)))
intermediateColumn.setReferencedColumnName(
((IntermediateSimpleProperty) ((IntermediateEntityType>) targetEntity)
.getKey().get(0)).getDBFieldName());
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEmbeddedIdProperty.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEmbeddedIdProperty.java
index dfe037e2e..7ccec97f8 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEmbeddedIdProperty.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEmbeddedIdProperty.java
@@ -4,12 +4,12 @@
import java.lang.reflect.AnnotatedElement;
-import javax.persistence.metamodel.Attribute;
-
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmTransient;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEdmNameBuilder;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.metamodel.Attribute;
+
final class IntermediateEmbeddedIdProperty extends IntermediateSimpleProperty {
IntermediateEmbeddedIdProperty(final JPAEdmNameBuilder nameBuilder, final Attribute, ?> jpaAttribute,
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntityType.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntityType.java
index 1e4b1e69d..74142c08c 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntityType.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntityType.java
@@ -1,7 +1,5 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
-import static com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys.INVALID_TOP_LEVEL_SETTING;
-
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Field;
@@ -15,17 +13,8 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
-import java.util.stream.Collectors;
import javax.annotation.Nonnull;
-import javax.persistence.IdClass;
-import javax.persistence.Table;
-import javax.persistence.metamodel.EmbeddableType;
-import javax.persistence.metamodel.EntityType;
-import javax.persistence.metamodel.IdentifiableType;
-import javax.persistence.metamodel.ManagedType;
-import javax.persistence.metamodel.MappedSuperclassType;
-import javax.persistence.metamodel.Type;
import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
@@ -34,7 +23,6 @@
import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef;
import org.apache.olingo.server.api.uri.UriResourceProperty;
-import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmAsEntitySet;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmEntityType;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmQueryExtensionProvider;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmTopLevelElementRepresentation;
@@ -49,6 +37,15 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.IntermediateEntityTypeAccess;
+import jakarta.persistence.IdClass;
+import jakarta.persistence.Table;
+import jakarta.persistence.metamodel.EmbeddableType;
+import jakarta.persistence.metamodel.EntityType;
+import jakarta.persistence.metamodel.IdentifiableType;
+import jakarta.persistence.metamodel.ManagedType;
+import jakarta.persistence.metamodel.MappedSuperclassType;
+import jakarta.persistence.metamodel.Type;
+
/**
* getAttribute(final UriResourceProperty uriResource
@Override
public JPACollectionAttribute getCollectionAttribute(final String externalName) throws ODataJPAModelException {
final JPAPath path = getPath(externalName);
- if (path != null && path.getLeaf() instanceof JPACollectionAttribute)
- return (JPACollectionAttribute) path.getLeaf();
+ if (path != null && path.getLeaf() instanceof final JPACollectionAttribute collectionAttribute)
+ return collectionAttribute;
return null;
}
@@ -160,7 +157,7 @@ public List getKey() throws ODataJPAModelException {
.map(ManagedType::getJavaType)
.map(Class::getDeclaredFields)
.flatMap(Arrays::stream)
- .collect(Collectors.toList()));
+ .toList());
final IntermediateStructuredType> baseType = getBaseType();
if (baseType != null) {
@@ -292,12 +289,11 @@ protected List extractEdmModelElements(
for (final IntermediateModelElement element : mappingBuffer.values()) {
if (!element.ignore()
// Skip Streams
- && !(element instanceof IntermediateSimpleProperty &&
- ((IntermediateSimpleProperty) element).isStream())) {
- if (element instanceof IntermediateEmbeddedIdProperty) {
- extractionTarget.addAll((Collection extends I>) resolveEmbeddedId(
- (IntermediateEmbeddedIdProperty) element));
- } else {
+ && !(element instanceof final IntermediateSimpleProperty simpleProperty
+ && simpleProperty.isStream())) {
+ if (element instanceof final IntermediateEmbeddedIdProperty embeddedId) {
+ extractionTarget.addAll((Collection extends I>) resolveEmbeddedId(embeddedId));
+ } else {
extractionTarget.add((I) element.getEdmItem());
}
}
@@ -326,7 +322,6 @@ protected synchronized void lazyBuildEdmItem() throws ODataJPAModelException {
((CsdlEntityType) edmStructuralType).setHasStream(determineHasStream());
edmStructuralType.setAnnotations(determineAnnotations());
determineHasEtag();
- checkTopLevelTypeConsistency();
checkPropertyConsistency(); //
// TODO determine OpenType
}
@@ -396,7 +391,7 @@ List extractEdmKeyElements() throws ODataJPAModelException {
return getKey().stream()
.map(this::asPropertyRef)
- .collect(Collectors.toList());
+ .toList();
}
@Override
@@ -447,23 +442,14 @@ private List buildEmbeddedIdKey(final JPAAttribute attribute) thro
return keyElements;
}
- private void checkTopLevelTypeConsistency() throws ODataJPAModelException {
- final Optional jpaAsEntitySet = getAnnotation(jpaJavaType, EdmAsEntitySet.class);
- final Optional jpaEntityType = getAnnotation(jpaJavaType, EdmEntityType.class);
- if (jpaAsEntitySet.isPresent() && jpaEntityType.isPresent())
- throw new ODataJPAModelException(INVALID_TOP_LEVEL_SETTING, getInternalName());
- }
-
private List determineAnnotations() throws ODataJPAModelException {
getAnnotations(edmAnnotations, this.jpaManagedType.getJavaType(), internalName);
return edmAnnotations;
}
private boolean determineAsEntitySet() {
- final Optional jpaAsEntitySet = getAnnotation(jpaJavaType, EdmAsEntitySet.class);
final Optional jpaEntityType = getAnnotation(jpaJavaType, EdmEntityType.class);
- return jpaAsEntitySet.isPresent()
- || !jpaEntityType.isPresent()
+ return !jpaEntityType.isPresent()
|| jpaEntityType.get().as() == EdmTopLevelElementRepresentation.AS_ENTITY_SET
|| jpaEntityType.get().as() == EdmTopLevelElementRepresentation.AS_ENTITY_SET_ONLY;
}
@@ -475,12 +461,10 @@ private boolean determineAsSingleton() {
}
private boolean determineAsTopLevelOnly() {
- final Optional jpaAsEntitySet = getAnnotation(jpaJavaType, EdmAsEntitySet.class);
final Optional jpaEntityType = getAnnotation(jpaJavaType, EdmEntityType.class);
- return jpaAsEntitySet.isPresent()
- || (jpaEntityType.isPresent()
- && (jpaEntityType.get().as() == EdmTopLevelElementRepresentation.AS_ENTITY_SET_ONLY
- || jpaEntityType.get().as() == EdmTopLevelElementRepresentation.AS_SINGLETON_ONLY));
+ return (jpaEntityType.isPresent()
+ && (jpaEntityType.get().as() == EdmTopLevelElementRepresentation.AS_ENTITY_SET_ONLY
+ || jpaEntityType.get().as() == EdmTopLevelElementRepresentation.AS_SINGLETON_ONLY));
}
@SuppressWarnings("unchecked")
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEnumerationType.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEnumerationType.java
index d5a12f58e..b2a531c4d 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEnumerationType.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEnumerationType.java
@@ -6,8 +6,6 @@
import java.util.Arrays;
import java.util.List;
-import javax.persistence.AttributeConverter;
-
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember;
@@ -20,6 +18,8 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys;
+import jakarta.persistence.AttributeConverter;
+
class IntermediateEnumerationType extends IntermediateModelElement implements JPAEnumerationAttribute {
private CsdlEnumType edmEnumType;
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateFunctionFactory.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateFunctionFactory.java
index 6615210bf..ecffd6fb6 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateFunctionFactory.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateFunctionFactory.java
@@ -5,8 +5,6 @@
import java.util.HashMap;
import java.util.Map;
-import javax.persistence.metamodel.EntityType;
-
import org.reflections8.Reflections;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmFunction;
@@ -15,7 +13,9 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.ODataFunction;
-final class IntermediateFunctionFactory extends IntermediateOperationFactory {
+import jakarta.persistence.metamodel.EntityType;
+
+final class IntermediateFunctionFactory implements IntermediateOperationFactory {
/**
* Creates all functions declared at on entity type
@@ -55,7 +55,7 @@ Map create(final JPAEdmNameBuilder nameBuilder,
@SuppressWarnings("unchecked")
@Override
- F createOperation(final JPAEdmNameBuilder nameBuilder, final IntermediateSchema schema,
+ public F createOperation(final JPAEdmNameBuilder nameBuilder, final IntermediateSchema schema,
final Method method, final Object functionDescription)
throws ODataJPAModelException {
return (F) new IntermediateJavaFunction(nameBuilder, (EdmFunction) functionDescription, method, schema);
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinColumn.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinColumn.java
index 16f73d304..21e27c525 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinColumn.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinColumn.java
@@ -1,6 +1,6 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
-import javax.persistence.JoinColumn;
+import jakarta.persistence.JoinColumn;
import com.sap.olingo.jpa.metadata.api.JPAJoinColumn;
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinTable.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinTable.java
index d08a8abc1..b4978ab50 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinTable.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinTable.java
@@ -5,10 +5,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
-import java.util.stream.Collectors;
-
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -20,6 +16,9 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+
class IntermediateJoinTable implements JPAJoinTable {
private static final Log LOGGER = LogFactory.getLog(IntermediateJoinTable.class);
@@ -103,7 +102,7 @@ public List getJoinColumns() throws ODataJPAModelException {
public List getRightColumnsList() throws ODataJPAModelException {
return getInverseJoinColumns().stream()
.map(JPAOnConditionItem::getRightPath)
- .collect(Collectors.toList());
+ .toList();
}
@Override
@@ -111,7 +110,7 @@ public List getLeftColumnsList() throws ODataJPAModelException {
return getJoinColumns().stream()
.map(JPAOnConditionItem::getLeftPath)
- .collect(Collectors.toList());
+ .toList();
}
@SuppressWarnings("unchecked")
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateModelElement.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateModelElement.java
index bb7994adb..f31f62471 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateModelElement.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateModelElement.java
@@ -139,8 +139,8 @@ protected String returnNullIfEmpty(final String value) {
*/
protected void getAnnotations(final List edmAnnotations, final Member member,
final String internalName) throws ODataJPAModelException {
- if (member instanceof AnnotatedElement) {
- extractAnnotations(edmAnnotations, (AnnotatedElement) member, internalName);
+ if (member instanceof final AnnotatedElement annotatedElement) {
+ extractAnnotations(edmAnnotations, annotatedElement, internalName);
}
}
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateNavigationProperty.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateNavigationProperty.java
index 61ecff487..cab09edff 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateNavigationProperty.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateNavigationProperty.java
@@ -1,709 +1,710 @@
-package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
-
-import static com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys.MISSING_ONE_TO_ONE_ANNOTATION;
-import static com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys.REFERENCED_PROPERTY_NOT_FOUND;
-
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Optional;
-import java.util.Set;
-
-import javax.annotation.CheckForNull;
-import javax.persistence.AssociationOverride;
-import javax.persistence.AttributeConverter;
-import javax.persistence.CascadeType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinColumns;
-import javax.persistence.ManyToMany;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.Attribute.PersistentAttributeType;
-import javax.persistence.metamodel.PluralAttribute;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
-import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty;
-import org.apache.olingo.commons.api.edm.provider.CsdlOnDelete;
-import org.apache.olingo.commons.api.edm.provider.CsdlOnDeleteAction;
-import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint;
-
-import com.sap.olingo.jpa.metadata.api.JPAJoinColumn;
-import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmIgnore;
-import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmProtectedBy;
-import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmTransientPropertyCalculator;
-import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmVisibleFor;
-import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationAttribute;
-import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationPath;
-import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEdmNameBuilder;
-import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAJoinTable;
-import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAStructuredType;
-import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
-import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys;
-import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelIgnoreException;
-import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.IntermediateNavigationPropertyAccess;
-
-/**
- * A navigation property describes a relation of one entity type to another entity type and allows to navigate to it.
- * IntermediateNavigationProperty represents a navigation within on service, that is source and target are described by
- * the same service document.
- * OData Version 4.0 Part 3 - 7 Navigation Property
- * @author Oliver Grande
- * @param Type of the parent the navigation belongs to, also called source type
- */
-final class IntermediateNavigationProperty extends IntermediateModelElement implements
- IntermediateNavigationPropertyAccess, JPAAssociationAttribute {
-
- private static final Log LOGGER = LogFactory.getLog(IntermediateNavigationProperty.class);
-
- private final Attribute, ?> jpaAttribute;
- private CsdlNavigationProperty edmNaviProperty;
- private CsdlOnDelete edmOnDelete;
- private final IntermediateStructuredType sourceType;
- private IntermediateStructuredType> targetType;
- private JPAAssociationAttribute partner;
- private IntermediateJoinTable joinTable;
- private final IntermediateSchema schema;
- private final List joinColumns = new ArrayList<>();
- private final List requiredDbColumns = new ArrayList<>();
- private PersistentAttributeType cardinality;
- private Optional mappedBy;
-
- IntermediateNavigationProperty(final JPAEdmNameBuilder nameBuilder, final IntermediateStructuredType parent,
- final Attribute, ?> jpaAttribute, final IntermediateSchema schema) throws ODataJPAModelException {
- super(nameBuilder, InternalNameBuilder.buildAssociationName(jpaAttribute), schema.getAnnotationInformation());
- this.jpaAttribute = jpaAttribute;
- this.schema = schema;
- this.sourceType = parent;
- buildNaviProperty();
- }
-
- @Override
- public void addAnnotations(final List annotations) {
- edmAnnotations.addAll(annotations);
- }
-
- @Override
- public > Constructor getCalculatorConstructor() {
- return null;
- }
-
- @Override
- public AttributeConverter getConverter() {
- return null;
- }
-
- @Override
- public Class> getDbType() {
- return null;
- }
-
- @Override
- public Class> getJavaType() {
- return null;
- }
-
- @Override
- public EdmPrimitiveTypeKind getEdmType() {
- return null;
- }
-
- public JPAJoinTable getJoinTable() {
- return joinTable;
- }
-
- @Override
- public JPAAssociationAttribute getPartner() {
- return partner;
- }
-
- @Override
- public JPAAssociationPath getPath() throws ODataJPAModelException {
- return getStructuredType().getAssociationPath(getExternalName());
- }
-
- @Override
- public CsdlNavigationProperty getProperty() throws ODataJPAModelException {
- return getEdmItem();
-
- }
-
- @Override
- public Set getProtectionClaimNames() {
- return new HashSet<>(0);
- }
-
- @Override
- public List getProtectionPath(final String claimName) throws ODataJPAModelException {
- return new ArrayList<>(0);
- }
-
- @Override
- public AttributeConverter getRawConverter() {
- return null;
- }
-
- @Override
- public List getRequiredProperties() {
- return Collections.emptyList();
- }
-
- @Override
- public JPAStructuredType getStructuredType() throws ODataJPAModelException {
- if (edmNaviProperty == null) {
- lazyBuildEdmItem();
- }
- return sourceType;
- }
-
- @Override
- public JPAStructuredType getTargetEntity() throws ODataJPAModelException {
- if (edmNaviProperty == null) {
- lazyBuildEdmItem();
- }
- return targetType;
- }
-
- @Override
- public Class> getType() {
- return jpaAttribute.getJavaType();
- }
-
- @Override
- public boolean hasProtection() {
- return false;
- }
-
- @Override
- public boolean isAssociation() {
- return true;
- }
-
- @Override
- public boolean isCollection() {
- return jpaAttribute.isCollection();
- }
-
- @Override
- public boolean isComplex() {
- return false;
- }
-
- @Override
- public boolean isEnum() {
- return false;
- }
-
- @Override
- public boolean isEtag() {
- return false;
- }
-
- @Override
- public boolean isKey() {
- return false;
- }
-
- @Override
- public boolean isSearchable() {
- return false;
- }
-
- @Override
- public boolean isTransient() {
- return false;
- }
-
- @Override
- public void setOnDelete(final CsdlOnDelete onDelete) {
- edmOnDelete = onDelete;
- }
-
- @Override
- public String toString() {
- return getExternalName() + ": [sourceType=" + sourceType + ", targetType=" + targetType
- + ", partner=" + partnerToString() + ", joinTable=" + joinTable + "]";
- }
-
- private String partnerToString() {
- return partner == null ? "null" : partner.getExternalName();
- }
-
- @Override
- protected synchronized void lazyBuildEdmItem() throws ODataJPAModelException {
- if (edmNaviProperty == null) {
- edmNaviProperty = new CsdlNavigationProperty();
- edmNaviProperty.setName(getExternalName());
- edmNaviProperty.setType(buildFQN(targetType.getExternalName()));
- edmNaviProperty.setCollection(jpaAttribute.isCollection());
- edmNaviProperty.setAnnotations(edmAnnotations);
- // Optional --> RelationAnnotation
- determineMappedBy();
- buildJoinConditionInfo();
- // TODO determine ContainsTarget
- determinePartner();
- }
- }
-
- @Override
- CsdlNavigationProperty getEdmItem() throws ODataJPAModelException {
- if (edmNaviProperty == null) {
- lazyBuildEdmItem();
- }
- return edmNaviProperty;
- }
-
- @Override
- public CsdlAnnotation getAnnotation(final String alias, final String term) throws ODataJPAModelException {
- return filterAnnotation(alias, term);
- }
-
- PersistentAttributeType getJoinCardinality() {
- return jpaAttribute.getPersistentAttributeType();
- }
-
- @SuppressWarnings("unchecked")
- List getJoinColumns() throws ODataJPAModelException {
- if (joinColumns.isEmpty()) {
- lazyBuildEdmItem();
- buildJoinConditionInfo();
- }
- return (List) joinColumns;
- }
-
- List getRequiredDbColumns() throws ODataJPAModelException {
- if (edmNaviProperty == null)
- lazyBuildEdmItem();
- if (requiredDbColumns.isEmpty()) {
- for (final IntermediateJoinColumn joinColumn : joinColumns) {
- requiredDbColumns.add(joinColumn.getName());
- }
- }
- return requiredDbColumns;
- }
-
- IntermediateStructuredType getSourceType() {
- return sourceType;
- }
-
- boolean isMapped() {
- return mappedBy.isPresent();
- }
-
- /**
- * In case the column name is not given at an association a default name is generated according to the JPA standard.
- * The default name will be <association name>_<target key name>, all upper case.
- * @param annotatedElement
- * @param isSourceOne
- * @return
- * @throws ODataJPAModelException
- */
- private String buildDefaultName(final boolean isSourceOne) throws ODataJPAModelException {
-
- final StringBuilder columnName = new StringBuilder(jpaAttribute.getName());
- columnName.append('_');
- if (isSourceOne)
- columnName.append(((IntermediateSimpleProperty) ((IntermediateEntityType>) targetType)
- .getKey().get(0)).getDBFieldName());
- else
- columnName.append(((IntermediateSimpleProperty) ((IntermediateEntityType>) sourceType)
- .getKey().get(0)).getDBFieldName());
- return columnName.toString().replace("\"", "").toUpperCase(Locale.ENGLISH);
- }
-
- private IntermediateJoinColumn buildImplicitJoinColumnPair(final boolean isSourceOne) throws ODataJPAModelException {
- final IntermediateJoinColumn intermediateColumn = new IntermediateJoinColumn(buildDefaultName(isSourceOne),
- fillMissingName());
- if (LOGGER.isTraceEnabled())
- LOGGER.trace(getExternalName() + ": Add join condition with default name = " + intermediateColumn.toString());
- return intermediateColumn;
- }
-
- private void buildJoinColumnPairList(final boolean isSourceOne, int implicitColumns,
- final List result, final JoinColumn[] columns) throws ODataJPAModelException {
- for (final JoinColumn column : columns) {
- final String refColumnName = column.referencedColumnName();
- final String name = column.name();
- result.add(buildOneJoinColumnPair(isSourceOne, column));
- if (refColumnName == null || refColumnName.isEmpty() || name == null || name.isEmpty()) {
- implicitColumns += 1;
- if (implicitColumns > 1)
- throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.NOT_SUPPORTED_NO_IMPLICIT_COLUMNS,
- getInternalName());
- }
- }
- }
-
- private void buildJoinColumns(final boolean isSourceOne, final AnnotatedElement annotatedElement)
- throws ODataJPAModelException {
-
- joinColumns.clear();
- final List columns;
- if (mappedBy.isPresent()) {
- joinTable = ((IntermediateJoinTable) ((IntermediateNavigationProperty>) targetType.getAssociation(
- mappedBy.get())).getJoinTable());
- if (joinTable == null)
- columns = buildJoinColumnsMapped(mappedBy.get());
- else
- columns = joinTable.buildInverseJoinColumns();
- joinTable = joinTable == null ? null : joinTable.asMapped(this);
- } else {
- if (joinTable == null)
- columns = buildJoinColumnsFromAnnotations(isSourceOne, annotatedElement);
- else
- columns = joinTable.buildJoinColumns();
- }
- joinColumns.clear();
- joinColumns.addAll(columns);
- }
-
- private List buildJoinColumnsFromAnnotations(final boolean isSourceOne,
- final AnnotatedElement annotatedElement) throws ODataJPAModelException {
-
- final int implicitColumns = 0;
- final List result = new ArrayList<>();
- final JoinColumn[] columns = annotatedElement.getAnnotation(JoinColumns.class) != null ? annotatedElement
- .getAnnotation(JoinColumns.class).value() : null;
-
- if (columns != null) {
- buildJoinColumnPairList(isSourceOne, implicitColumns, result, columns);
- } else {
- final JoinColumn column = annotatedElement.getAnnotation(JoinColumn.class);
- if (column != null) {
- result.add(buildOneJoinColumnPair(isSourceOne, column));
- } else {
- // No explicit Join Columns given: Build implicit one.
- result.add(buildImplicitJoinColumnPair(isSourceOne));
- }
- }
- return result;
- }
-
- private List buildJoinColumnsMapped(final String mappedBy) throws ODataJPAModelException {
-
- int implicitColumns = 0;
- final List result = invertJoinColumns(targetType.getJoinColumns(mappedBy));
- for (final IntermediateJoinColumn intermediateColumn : result) {
- final String columnName = intermediateColumn.getName();
- if (columnName == null || columnName.isEmpty()) {
- implicitColumns += 1;
- if (implicitColumns > 1)
- throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.NOT_SUPPORTED_NO_IMPLICIT_COLUMNS,
- getInternalName());
- intermediateColumn.setName(((IntermediateProperty) ((IntermediateEntityType>) sourceType)
- .getKey().get(0)).getDBFieldName());
- }
- }
- return result;
- }
-
- private void buildJoinConditionInfo() throws ODataJPAModelException {
-
- if (jpaAttribute.getJavaMember() instanceof AnnotatedElement
- && joinColumns.isEmpty()) {
- final AnnotatedElement annotatedElement = (AnnotatedElement) jpaAttribute.getJavaMember();
-// Determine referential constraint
- final boolean isOwner = !mappedBy.isPresent();
- buildJoinColumns(isOwner, annotatedElement);
- determineReferentialConstraints(annotatedElement);
- }
- }
-
- private void buildNaviProperty() throws ODataJPAModelException {
-
- this.setExternalName(nameBuilder.buildNaviPropertyName(jpaAttribute));
-
- evaluateAnnotation();
-
- targetType = schema.getEntityType(determineTargetClass());
- if (targetType == null)
- throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.NAVI_PROPERTY_NOT_FOUND,
- jpaAttribute.getName(), sourceType.internalName);
-
- postProcessor.processNavigationProperty(this, jpaAttribute.getDeclaringType().getJavaType()
- .getCanonicalName());
- // Process annotations after post processing, as external name could have been changed
- getAnnotations(edmAnnotations, this.jpaAttribute.getJavaMember(), internalName);
-
- checkConsistency();
- if (LOGGER.isTraceEnabled())
- LOGGER.trace(toString());
- }
-
- private void evaluateAnnotation() throws ODataJPAModelException {
-
- if (this.jpaAttribute.getJavaMember() instanceof AnnotatedElement) {
- final EdmIgnore jpaIgnore = ((AnnotatedElement) this.jpaAttribute.getJavaMember()).getAnnotation(
- EdmIgnore.class);
- if (jpaIgnore != null) {
- this.setIgnore(true);
- }
- final javax.persistence.JoinTable jpaJoinTable = ((AnnotatedElement) this.jpaAttribute.getJavaMember())
- .getAnnotation(javax.persistence.JoinTable.class);
- joinTable = jpaJoinTable != null ? new IntermediateJoinTable(this, jpaJoinTable, schema) : null;
-
- final AnnotatedElement annotatedElement = (AnnotatedElement) jpaAttribute.getJavaMember();
- cardinality = jpaAttribute.getPersistentAttributeType();
- if (cardinality != null) {
- switch (cardinality) {
- case ONE_TO_MANY:
- // Association '%1$s' of '%2$s' requires a cardinality annotation.
- final OneToMany oneTOMany = Optional.ofNullable(annotatedElement.getAnnotation(OneToMany.class))
- .orElseThrow(() -> new ODataJPAModelException(MISSING_ONE_TO_ONE_ANNOTATION, internalName, sourceType
- .getInternalName()));
- mappedBy = Optional.ofNullable(returnNullIfEmpty(oneTOMany.mappedBy()));
- break;
- case ONE_TO_ONE:
- // Association '%1$s' of '%2$s' requires a cardinality annotation.
- final OneToOne oneToOne = Optional.ofNullable(annotatedElement.getAnnotation(OneToOne.class))
- .orElseThrow(() -> new ODataJPAModelException(MISSING_ONE_TO_ONE_ANNOTATION, internalName, sourceType
- .getInternalName()));
- mappedBy = Optional.ofNullable(returnNullIfEmpty(oneToOne.mappedBy()));
- break;
- case MANY_TO_MANY:
- mappedBy = Optional.ofNullable(returnNullIfEmpty(
- annotatedElement.getAnnotation(ManyToMany.class).mappedBy()));
- break;
- default:
- mappedBy = Optional.empty();
- }
- } else {
- mappedBy = Optional.empty();
- }
- }
- }
-
- private Class> determineTargetClass() {
- Class> targetClass = null;
- if (jpaAttribute.isCollection()) {
- targetClass = ((PluralAttribute, ?, ?>) jpaAttribute).getElementType().getJavaType();
- } else {
- targetClass = jpaAttribute.getJavaType();
- }
- return targetClass;
- }
-
- private IntermediateJoinColumn buildOneJoinColumnPair(final boolean isSourceOne, final JoinColumn column)
- throws ODataJPAModelException {
- IntermediateJoinColumn intermediateColumn = new IntermediateJoinColumn(column);
- if (cardinality == PersistentAttributeType.ONE_TO_MANY)
- intermediateColumn = new IntermediateJoinColumn(intermediateColumn.getReferencedColumnName(),
- intermediateColumn.getName());
- fillMissingName(isSourceOne, intermediateColumn);
- if (LOGGER.isTraceEnabled())
- LOGGER.trace(getExternalName() + ": Add join condition = " + intermediateColumn.toString());
- return intermediateColumn;
- }
-
- private void checkConsistency() throws ODataJPAModelException {
- final EdmProtectedBy jpaProtectedBy = ((AnnotatedElement) this.jpaAttribute.getJavaMember())
- .getAnnotation(EdmProtectedBy.class);
- if (jpaProtectedBy != null) {
- // Navigation Properties do not support EdmProtectedBy
- throw new ODataJPAModelException(MessageKeys.NOT_SUPPORTED_PROTECTED_NAVIGATION, this.sourceType.getTypeClass()
- .getCanonicalName(), this.internalName);
- }
- final EdmVisibleFor jpaFieldGroups = ((AnnotatedElement) this.jpaAttribute.getJavaMember())
- .getAnnotation(EdmVisibleFor.class);
- if (jpaFieldGroups != null) {
- throw new ODataJPAModelException(MessageKeys.NOT_SUPPORTED_NAVIGATION_PART_OF_GROUP,
- this.sourceType.getTypeClass().getCanonicalName(), this.internalName);
- }
- }
-
- @CheckForNull
- private void determineMappedBy() {
-
- if (jpaAttribute.getJavaMember() instanceof AnnotatedElement) {
- final AnnotatedElement annotatedElement = (AnnotatedElement) jpaAttribute.getJavaMember();
- cardinality = jpaAttribute.getPersistentAttributeType();
- switch (cardinality) {
- case ONE_TO_MANY:
- final OneToMany cardinalityOtM = annotatedElement.getAnnotation(OneToMany.class);
- edmNaviProperty.setOnDelete(edmOnDelete != null ? edmOnDelete : setJPAOnDelete(cardinalityOtM.cascade()));
- break;
- case ONE_TO_ONE:
- final OneToOne cardinalityOtO = annotatedElement.getAnnotation(OneToOne.class);
- edmNaviProperty.setNullable(cardinalityOtO.optional());
- edmNaviProperty.setOnDelete(edmOnDelete != null ? edmOnDelete : setJPAOnDelete(cardinalityOtO.cascade()));
- break;
- case MANY_TO_ONE:
- final ManyToOne cardinalityMtO = annotatedElement.getAnnotation(ManyToOne.class);
- edmNaviProperty.setNullable(cardinalityMtO.optional());
- edmNaviProperty.setOnDelete(edmOnDelete != null ? edmOnDelete : setJPAOnDelete(cardinalityMtO.cascade()));
- break;
- case MANY_TO_MANY:
- final ManyToMany cardinalityMtM = annotatedElement.getAnnotation(ManyToMany.class);
- edmNaviProperty.setOnDelete(edmOnDelete != null ? edmOnDelete : setJPAOnDelete(cardinalityMtM.cascade()));
- break;
- default:
- break;
- }
- }
- }
-
- private void determinePartner() throws ODataJPAModelException {
- if (sourceType instanceof IntermediateEntityType) {
- // Partner Attribute must not be defined at Complex Types.
- // JPA bi-directional associations are defined at both sides, e.g.
- // at the BusinessPartner and at the Roles. JPA only defines the
- // "mappedBy" at the Parent.
- if (mappedBy.isPresent()) {
- partner = targetType.getAssociation(mappedBy.get());
- edmNaviProperty.setPartner(partner.getExternalName());
- } else {
- partner = targetType.getCorrespondingAssociation(sourceType, getInternalName());
- if (partner != null
- && ((IntermediateNavigationProperty>) partner).isMapped()) {
- edmNaviProperty.setPartner(partner.getExternalName());
- }
- }
- if (LOGGER.isTraceEnabled())
- LOGGER.trace(getExternalName() + ": Found partner = " + partnerToString());
- }
- }
-
- private Optional determineReferentialConstraint(
- final IntermediateJoinColumn intermediateColumn) throws ODataJPAModelException, ODataJPAModelIgnoreException {
-
- final CsdlReferentialConstraint constraint = new CsdlReferentialConstraint();
- boolean ignore = false;
- IntermediateModelElement p = null;
- p = sourceType.getPropertyByDBField(intermediateColumn.getName());
- if (p != null) {
- if (p.ignore())
- ignore = true;
- constraint.setProperty(p.getExternalName());
- p = targetType.getPropertyByDBField(intermediateColumn.getReferencedColumnName());
- if (p != null) {
- if (p.ignore())
- ignore = true;
- constraint.setReferencedProperty(p.getExternalName());
- } else {
- throw new ODataJPAModelException(REFERENCED_PROPERTY_NOT_FOUND, getInternalName(), intermediateColumn
- .getReferencedColumnName(), targetType.getExternalName());
- }
- } else {
- if (targetType.getPropertyByDBField(intermediateColumn.getReferencedColumnName()) != null) {
- LOGGER.trace("Cloud not determine referential constraint for " + this.getType().getName() + "#"
- + getInternalName());
- throw new ODataJPAModelIgnoreException();
- } else
- return Optional.empty();
- }
- if (ignore)
- throw new ODataJPAModelIgnoreException();
- return Optional.of(constraint);
- }
-
- private void determineReferentialConstraints(final AnnotatedElement annotatedElement) throws ODataJPAModelException {
-
- final AssociationOverride overwrite = annotatedElement.getAnnotation(AssociationOverride.class);
- if (overwrite != null || joinTable != null)
- return;
-
- final List constraints = edmNaviProperty.getReferentialConstraints();
- constraints.clear();
- boolean ignore = false;
- for (final IntermediateJoinColumn intermediateColumn : joinColumns) {
- try {
- Optional constraint = determineReferentialConstraint(intermediateColumn);
- if (!constraint.isPresent())
- constraint = determineReverseReferentialConstraint(intermediateColumn);
- constraints.add(constraint.orElseThrow(
- () -> new ODataJPAModelException(REFERENCED_PROPERTY_NOT_FOUND, getInternalName(), intermediateColumn
- .getReferencedColumnName(), sourceType.getExternalName())));
- } catch (final ODataJPAModelIgnoreException e) {
- ignore = true;
- }
- }
- if (ignore)
- constraints.clear();
- }
-
- private Optional determineReverseReferentialConstraint(
- final IntermediateJoinColumn intermediateColumn) throws ODataJPAModelException, ODataJPAModelIgnoreException {
-
- final CsdlReferentialConstraint constraint = new CsdlReferentialConstraint();
- boolean ignore = false;
- IntermediateModelElement p = null;
- p = sourceType.getPropertyByDBField(intermediateColumn.getReferencedColumnName());
- if (p != null) {
- if (p.ignore())
- ignore = true;
- constraint.setProperty(p.getExternalName());
- p = targetType.getPropertyByDBField(intermediateColumn.getName());
- if (p != null) {
- if (p.ignore())
- ignore = true;
- constraint.setReferencedProperty(p.getExternalName());
- } else {
- // Target not found: system will fallback to default column names, no referential constraint can be given
- LOGGER.trace("Cloud not determine referential constraint for " + this.getType().getName() + "#"
- + getInternalName());
- throw new ODataJPAModelIgnoreException();
- }
- } else {
- return Optional.empty();
- }
- if (ignore)
- throw new ODataJPAModelIgnoreException();
- return Optional.of(constraint);
- }
-
- private String fillMissingName() throws ODataJPAModelException {
- return ((IntermediateSimpleProperty) ((IntermediateEntityType>) targetType)
- .getKey().get(0)).getDBFieldName();
- }
-
- private void fillMissingName(final boolean isSourceOne, final IntermediateJoinColumn intermediateColumn)
- throws ODataJPAModelException {
-
- final String referencedColumnName = intermediateColumn.getReferencedColumnName();
- final String name = intermediateColumn.getName();
-
- if (isSourceOne && (name == null || name.isEmpty()))
- intermediateColumn.setName(((IntermediateSimpleProperty) ((IntermediateEntityType>) sourceType)
- .getKey().get(0)).getDBFieldName());
- else if (isSourceOne && (referencedColumnName == null || referencedColumnName.isEmpty()))
- intermediateColumn.setReferencedColumnName(((IntermediateSimpleProperty) ((IntermediateEntityType>) targetType)
- .getKey().get(0)).getDBFieldName());
- else if (!isSourceOne && (referencedColumnName == null || referencedColumnName.isEmpty()))
- intermediateColumn.setName(((IntermediateSimpleProperty) ((IntermediateEntityType>) targetType)
- .getKey().get(0)).getDBFieldName());
- else if (!isSourceOne && (name == null || name.isEmpty()))
- intermediateColumn.setReferencedColumnName(((IntermediateSimpleProperty) ((IntermediateEntityType>) sourceType)
- .getKey().get(0)).getDBFieldName());
- }
-
- private List invertJoinColumns(final List joinColumns) {
- final List invertedJoinColumns = new ArrayList<>(joinColumns.size());
- for (final IntermediateJoinColumn joinColumn : joinColumns) {
- invertedJoinColumns.add(
- new IntermediateJoinColumn(joinColumn.getReferencedColumnName(), joinColumn.getName()));
- }
- return invertedJoinColumns;
- }
-
- private CsdlOnDelete setJPAOnDelete(final CascadeType[] cascades) {
- for (final CascadeType cascade : cascades) {
- if (cascade == CascadeType.REMOVE || cascade == CascadeType.ALL) {
- final CsdlOnDelete onDelete = new CsdlOnDelete();
- onDelete.setAction(CsdlOnDeleteAction.Cascade);
- return onDelete;
- }
- }
- return null;
- }
-
-}
+package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
+
+import static com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys.MISSING_ONE_TO_ONE_ANNOTATION;
+import static com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys.REFERENCED_PROPERTY_NOT_FOUND;
+
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Optional;
+import java.util.Set;
+
+import javax.annotation.CheckForNull;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
+import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty;
+import org.apache.olingo.commons.api.edm.provider.CsdlOnDelete;
+import org.apache.olingo.commons.api.edm.provider.CsdlOnDeleteAction;
+import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint;
+
+import com.sap.olingo.jpa.metadata.api.JPAJoinColumn;
+import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmIgnore;
+import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmProtectedBy;
+import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmTransientPropertyCalculator;
+import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmVisibleFor;
+import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationAttribute;
+import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationPath;
+import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEdmNameBuilder;
+import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAJoinTable;
+import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAStructuredType;
+import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys;
+import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelIgnoreException;
+import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.IntermediateNavigationPropertyAccess;
+
+import jakarta.persistence.AssociationOverride;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinColumns;
+import jakarta.persistence.ManyToMany;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.Attribute.PersistentAttributeType;
+import jakarta.persistence.metamodel.PluralAttribute;
+
+/**
+ * A navigation property describes a relation of one entity type to another entity type and allows to navigate to it.
+ * IntermediateNavigationProperty represents a navigation within on service, that is source and target are described by
+ * the same service document.
+ * OData Version 4.0 Part 3 - 7 Navigation Property
+ * @author Oliver Grande
+ * @param Type of the parent the navigation belongs to, also called source type
+ */
+final class IntermediateNavigationProperty extends IntermediateModelElement implements
+ IntermediateNavigationPropertyAccess, JPAAssociationAttribute {
+
+ private static final Log LOGGER = LogFactory.getLog(IntermediateNavigationProperty.class);
+
+ private final Attribute, ?> jpaAttribute;
+ private CsdlNavigationProperty edmNaviProperty;
+ private CsdlOnDelete edmOnDelete;
+ private final IntermediateStructuredType sourceType;
+ private IntermediateStructuredType> targetType;
+ private JPAAssociationAttribute partner;
+ private IntermediateJoinTable joinTable;
+ private final IntermediateSchema schema;
+ private final List joinColumns = new ArrayList<>();
+ private final List requiredDbColumns = new ArrayList<>();
+ private PersistentAttributeType cardinality;
+ private Optional mappedBy;
+
+ IntermediateNavigationProperty(final JPAEdmNameBuilder nameBuilder, final IntermediateStructuredType parent,
+ final Attribute, ?> jpaAttribute, final IntermediateSchema schema) throws ODataJPAModelException {
+ super(nameBuilder, InternalNameBuilder.buildAssociationName(jpaAttribute), schema.getAnnotationInformation());
+ this.jpaAttribute = jpaAttribute;
+ this.schema = schema;
+ this.sourceType = parent;
+ buildNaviProperty();
+ }
+
+ @Override
+ public void addAnnotations(final List annotations) {
+ edmAnnotations.addAll(annotations);
+ }
+
+ @Override
+ public > Constructor getCalculatorConstructor() {
+ return null;
+ }
+
+ @Override
+ public AttributeConverter getConverter() {
+ return null;
+ }
+
+ @Override
+ public Class> getDbType() {
+ return null;
+ }
+
+ @Override
+ public Class> getJavaType() {
+ return null;
+ }
+
+ @Override
+ public EdmPrimitiveTypeKind getEdmType() {
+ return null;
+ }
+
+ public JPAJoinTable getJoinTable() {
+ return joinTable;
+ }
+
+ @Override
+ public JPAAssociationAttribute getPartner() {
+ return partner;
+ }
+
+ @Override
+ public JPAAssociationPath getPath() throws ODataJPAModelException {
+ return getStructuredType().getAssociationPath(getExternalName());
+ }
+
+ @Override
+ public CsdlNavigationProperty getProperty() throws ODataJPAModelException {
+ return getEdmItem();
+
+ }
+
+ @Override
+ public Set getProtectionClaimNames() {
+ return new HashSet<>(0);
+ }
+
+ @Override
+ public List getProtectionPath(final String claimName) throws ODataJPAModelException {
+ return new ArrayList<>(0);
+ }
+
+ @Override
+ public AttributeConverter getRawConverter() {
+ return null;
+ }
+
+ @Override
+ public List getRequiredProperties() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public JPAStructuredType getStructuredType() throws ODataJPAModelException {
+ if (edmNaviProperty == null) {
+ lazyBuildEdmItem();
+ }
+ return sourceType;
+ }
+
+ @Override
+ public JPAStructuredType getTargetEntity() throws ODataJPAModelException {
+ if (edmNaviProperty == null) {
+ lazyBuildEdmItem();
+ }
+ return targetType;
+ }
+
+ @Override
+ public Class> getType() {
+ return jpaAttribute.getJavaType();
+ }
+
+ @Override
+ public boolean hasProtection() {
+ return false;
+ }
+
+ @Override
+ public boolean isAssociation() {
+ return true;
+ }
+
+ @Override
+ public boolean isCollection() {
+ return jpaAttribute.isCollection();
+ }
+
+ @Override
+ public boolean isComplex() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnum() {
+ return false;
+ }
+
+ @Override
+ public boolean isEtag() {
+ return false;
+ }
+
+ @Override
+ public boolean isKey() {
+ return false;
+ }
+
+ @Override
+ public boolean isSearchable() {
+ return false;
+ }
+
+ @Override
+ public boolean isTransient() {
+ return false;
+ }
+
+ @Override
+ public void setOnDelete(final CsdlOnDelete onDelete) {
+ edmOnDelete = onDelete;
+ }
+
+ @Override
+ public String toString() {
+ return getExternalName() + ": [sourceType=" + sourceType + ", targetType=" + targetType
+ + ", partner=" + partnerToString() + ", joinTable=" + joinTable + "]";
+ }
+
+ private String partnerToString() {
+ return partner == null ? "null" : partner.getExternalName();
+ }
+
+ @Override
+ protected synchronized void lazyBuildEdmItem() throws ODataJPAModelException {
+ if (edmNaviProperty == null) {
+ edmNaviProperty = new CsdlNavigationProperty();
+ edmNaviProperty.setName(getExternalName());
+ edmNaviProperty.setType(buildFQN(targetType.getExternalName()));
+ edmNaviProperty.setCollection(jpaAttribute.isCollection());
+ edmNaviProperty.setAnnotations(edmAnnotations);
+ // Optional --> RelationAnnotation
+ determineMappedBy();
+ buildJoinConditionInfo();
+ // TODO determine ContainsTarget
+ determinePartner();
+ }
+ }
+
+ @Override
+ CsdlNavigationProperty getEdmItem() throws ODataJPAModelException {
+ if (edmNaviProperty == null) {
+ lazyBuildEdmItem();
+ }
+ return edmNaviProperty;
+ }
+
+ @Override
+ public CsdlAnnotation getAnnotation(final String alias, final String term) throws ODataJPAModelException {
+ return filterAnnotation(alias, term);
+ }
+
+ PersistentAttributeType getJoinCardinality() {
+ return jpaAttribute.getPersistentAttributeType();
+ }
+
+ @SuppressWarnings("unchecked")
+ List getJoinColumns() throws ODataJPAModelException {
+ if (joinColumns.isEmpty()) {
+ lazyBuildEdmItem();
+ buildJoinConditionInfo();
+ }
+ return (List) joinColumns;
+ }
+
+ List getRequiredDbColumns() throws ODataJPAModelException {
+ if (edmNaviProperty == null)
+ lazyBuildEdmItem();
+ if (requiredDbColumns.isEmpty()) {
+ for (final IntermediateJoinColumn joinColumn : joinColumns) {
+ requiredDbColumns.add(joinColumn.getName());
+ }
+ }
+ return requiredDbColumns;
+ }
+
+ IntermediateStructuredType getSourceType() {
+ return sourceType;
+ }
+
+ boolean isMapped() {
+ return mappedBy.isPresent();
+ }
+
+ /**
+ * In case the column name is not given at an association a default name is generated according to the JPA standard.
+ * The default name will be <association name>_<target key name>, all upper case.
+ * @param annotatedElement
+ * @param isSourceOne
+ * @return
+ * @throws ODataJPAModelException
+ */
+ private String buildDefaultName(final boolean isSourceOne) throws ODataJPAModelException {
+
+ final StringBuilder columnName = new StringBuilder(jpaAttribute.getName());
+ columnName.append('_');
+ if (isSourceOne)
+ columnName.append(((IntermediateSimpleProperty) ((IntermediateEntityType>) targetType)
+ .getKey().get(0)).getDBFieldName());
+ else
+ columnName.append(((IntermediateSimpleProperty) ((IntermediateEntityType>) sourceType)
+ .getKey().get(0)).getDBFieldName());
+ return columnName.toString().replace("\"", "").toUpperCase(Locale.ENGLISH);
+ }
+
+ private IntermediateJoinColumn buildImplicitJoinColumnPair(final boolean isSourceOne) throws ODataJPAModelException {
+ final IntermediateJoinColumn intermediateColumn = new IntermediateJoinColumn(buildDefaultName(isSourceOne),
+ fillMissingName());
+ if (LOGGER.isTraceEnabled())
+ LOGGER.trace(getExternalName() + ": Add join condition with default name = " + intermediateColumn.toString());
+ return intermediateColumn;
+ }
+
+ private void buildJoinColumnPairList(final boolean isSourceOne, int implicitColumns,
+ final List result, final JoinColumn[] columns) throws ODataJPAModelException {
+ for (final JoinColumn column : columns) {
+ final String refColumnName = column.referencedColumnName();
+ final String name = column.name();
+ result.add(buildOneJoinColumnPair(isSourceOne, column));
+ if (refColumnName == null || refColumnName.isEmpty() || name == null || name.isEmpty()) {
+ implicitColumns += 1;
+ if (implicitColumns > 1)
+ throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.NOT_SUPPORTED_NO_IMPLICIT_COLUMNS,
+ getInternalName());
+ }
+ }
+ }
+
+ private void buildJoinColumns(final boolean isSourceOne, final AnnotatedElement annotatedElement)
+ throws ODataJPAModelException {
+
+ joinColumns.clear();
+ final List columns;
+ if (mappedBy.isPresent()) {
+ joinTable = ((IntermediateJoinTable) ((IntermediateNavigationProperty>) targetType.getAssociation(
+ mappedBy.get())).getJoinTable());
+ if (joinTable == null)
+ columns = buildJoinColumnsMapped(mappedBy.get());
+ else
+ columns = joinTable.buildInverseJoinColumns();
+ joinTable = joinTable == null ? null : joinTable.asMapped(this);
+ } else {
+ if (joinTable == null)
+ columns = buildJoinColumnsFromAnnotations(isSourceOne, annotatedElement);
+ else
+ columns = joinTable.buildJoinColumns();
+ }
+ joinColumns.clear();
+ joinColumns.addAll(columns);
+ }
+
+ private List buildJoinColumnsFromAnnotations(final boolean isSourceOne,
+ final AnnotatedElement annotatedElement) throws ODataJPAModelException {
+
+ final int implicitColumns = 0;
+ final List result = new ArrayList<>();
+ final JoinColumn[] columns = annotatedElement.getAnnotation(JoinColumns.class) != null ? annotatedElement
+ .getAnnotation(JoinColumns.class).value() : null;
+
+ if (columns != null) {
+ buildJoinColumnPairList(isSourceOne, implicitColumns, result, columns);
+ } else {
+ final JoinColumn column = annotatedElement.getAnnotation(JoinColumn.class);
+ if (column != null) {
+ result.add(buildOneJoinColumnPair(isSourceOne, column));
+ } else {
+ // No explicit Join Columns given: Build implicit one.
+ result.add(buildImplicitJoinColumnPair(isSourceOne));
+ }
+ }
+ return result;
+ }
+
+ private List buildJoinColumnsMapped(final String mappedBy) throws ODataJPAModelException {
+
+ int implicitColumns = 0;
+ final List result = invertJoinColumns(targetType.getJoinColumns(mappedBy));
+ for (final IntermediateJoinColumn intermediateColumn : result) {
+ final String columnName = intermediateColumn.getName();
+ if (columnName == null || columnName.isEmpty()) {
+ implicitColumns += 1;
+ if (implicitColumns > 1)
+ throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.NOT_SUPPORTED_NO_IMPLICIT_COLUMNS,
+ getInternalName());
+ intermediateColumn.setName(((IntermediateProperty) ((IntermediateEntityType>) sourceType)
+ .getKey().get(0)).getDBFieldName());
+ }
+ }
+ return result;
+ }
+
+ private void buildJoinConditionInfo() throws ODataJPAModelException {
+
+ if (jpaAttribute.getJavaMember() instanceof AnnotatedElement
+ && joinColumns.isEmpty()) {
+ final AnnotatedElement annotatedElement = (AnnotatedElement) jpaAttribute.getJavaMember();
+// Determine referential constraint
+ final boolean isOwner = !mappedBy.isPresent();
+ buildJoinColumns(isOwner, annotatedElement);
+ determineReferentialConstraints(annotatedElement);
+ }
+ }
+
+ private void buildNaviProperty() throws ODataJPAModelException {
+
+ this.setExternalName(nameBuilder.buildNaviPropertyName(jpaAttribute));
+
+ evaluateAnnotation();
+
+ targetType = schema.getEntityType(determineTargetClass());
+ if (targetType == null)
+ throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.NAVI_PROPERTY_NOT_FOUND,
+ jpaAttribute.getName(), sourceType.internalName);
+
+ postProcessor.processNavigationProperty(this, jpaAttribute.getDeclaringType().getJavaType()
+ .getCanonicalName());
+ // Process annotations after post processing, as external name could have been changed
+ getAnnotations(edmAnnotations, this.jpaAttribute.getJavaMember(), internalName);
+
+ checkConsistency();
+ if (LOGGER.isTraceEnabled())
+ LOGGER.trace(toString());
+ }
+
+ private void evaluateAnnotation() throws ODataJPAModelException {
+
+ if (this.jpaAttribute.getJavaMember() instanceof AnnotatedElement) {
+ final EdmIgnore jpaIgnore = ((AnnotatedElement) this.jpaAttribute.getJavaMember()).getAnnotation(
+ EdmIgnore.class);
+ if (jpaIgnore != null) {
+ this.setIgnore(true);
+ }
+ final jakarta.persistence.JoinTable jpaJoinTable = ((AnnotatedElement) this.jpaAttribute.getJavaMember())
+ .getAnnotation(jakarta.persistence.JoinTable.class);
+ joinTable = jpaJoinTable != null ? new IntermediateJoinTable(this, jpaJoinTable, schema) : null;
+
+ final AnnotatedElement annotatedElement = (AnnotatedElement) jpaAttribute.getJavaMember();
+ cardinality = jpaAttribute.getPersistentAttributeType();
+ if (cardinality != null) {
+ switch (cardinality) {
+ case ONE_TO_MANY:
+ // Association '%1$s' of '%2$s' requires a cardinality annotation.
+ final OneToMany oneTOMany = Optional.ofNullable(annotatedElement.getAnnotation(OneToMany.class))
+ .orElseThrow(() -> new ODataJPAModelException(MISSING_ONE_TO_ONE_ANNOTATION, internalName, sourceType
+ .getInternalName()));
+ mappedBy = Optional.ofNullable(returnNullIfEmpty(oneTOMany.mappedBy()));
+ break;
+ case ONE_TO_ONE:
+ // Association '%1$s' of '%2$s' requires a cardinality annotation.
+ final OneToOne annotation = Optional.ofNullable(annotatedElement.getAnnotation(OneToOne.class))
+ .orElseThrow(() -> new ODataJPAModelException(MISSING_ONE_TO_ONE_ANNOTATION, internalName, sourceType
+ .getInternalName()));
+ mappedBy = Optional.ofNullable(returnNullIfEmpty(annotation.mappedBy()));
+ break;
+ case MANY_TO_MANY:
+ mappedBy = Optional.ofNullable(returnNullIfEmpty(
+ annotatedElement.getAnnotation(ManyToMany.class).mappedBy()));
+ break;
+ default:
+ mappedBy = Optional.empty();
+ }
+ } else {
+ mappedBy = Optional.empty();
+ }
+ }
+ }
+
+ private Class> determineTargetClass() {
+ Class> targetClass = null;
+ if (jpaAttribute.isCollection()) {
+ targetClass = ((PluralAttribute, ?, ?>) jpaAttribute).getElementType().getJavaType();
+ } else {
+ targetClass = jpaAttribute.getJavaType();
+ }
+ return targetClass;
+ }
+
+ private IntermediateJoinColumn buildOneJoinColumnPair(final boolean isSourceOne, final JoinColumn column)
+ throws ODataJPAModelException {
+ IntermediateJoinColumn intermediateColumn = new IntermediateJoinColumn(column);
+ if (cardinality == PersistentAttributeType.ONE_TO_MANY)
+ intermediateColumn = new IntermediateJoinColumn(intermediateColumn.getReferencedColumnName(),
+ intermediateColumn.getName());
+ fillMissingName(isSourceOne, intermediateColumn);
+ if (LOGGER.isTraceEnabled())
+ LOGGER.trace(getExternalName() + ": Add join condition = " + intermediateColumn.toString());
+ return intermediateColumn;
+ }
+
+ private void checkConsistency() throws ODataJPAModelException {
+ final EdmProtectedBy jpaProtectedBy = ((AnnotatedElement) this.jpaAttribute.getJavaMember())
+ .getAnnotation(EdmProtectedBy.class);
+ if (jpaProtectedBy != null) {
+ // Navigation Properties do not support EdmProtectedBy
+ throw new ODataJPAModelException(MessageKeys.NOT_SUPPORTED_PROTECTED_NAVIGATION, this.sourceType.getTypeClass()
+ .getCanonicalName(), this.internalName);
+ }
+ final EdmVisibleFor jpaFieldGroups = ((AnnotatedElement) this.jpaAttribute.getJavaMember())
+ .getAnnotation(EdmVisibleFor.class);
+ if (jpaFieldGroups != null) {
+ throw new ODataJPAModelException(MessageKeys.NOT_SUPPORTED_NAVIGATION_PART_OF_GROUP,
+ this.sourceType.getTypeClass().getCanonicalName(), this.internalName);
+ }
+ }
+
+ @CheckForNull
+ private void determineMappedBy() {
+
+ if (jpaAttribute.getJavaMember() instanceof AnnotatedElement) {
+ final AnnotatedElement annotatedElement = (AnnotatedElement) jpaAttribute.getJavaMember();
+ cardinality = jpaAttribute.getPersistentAttributeType();
+ switch (cardinality) {
+ case ONE_TO_MANY:
+ final OneToMany cardinalityOtM = annotatedElement.getAnnotation(OneToMany.class);
+ edmNaviProperty.setOnDelete(edmOnDelete != null ? edmOnDelete : setJPAOnDelete(cardinalityOtM.cascade()));
+ break;
+ case ONE_TO_ONE:
+ final OneToOne cardinalityOtO = annotatedElement.getAnnotation(OneToOne.class);
+ edmNaviProperty.setNullable(cardinalityOtO.optional());
+ edmNaviProperty.setOnDelete(edmOnDelete != null ? edmOnDelete : setJPAOnDelete(cardinalityOtO.cascade()));
+ break;
+ case MANY_TO_ONE:
+ final ManyToOne cardinalityMtO = annotatedElement.getAnnotation(ManyToOne.class);
+ edmNaviProperty.setNullable(cardinalityMtO.optional());
+ edmNaviProperty.setOnDelete(edmOnDelete != null ? edmOnDelete : setJPAOnDelete(cardinalityMtO.cascade()));
+ break;
+ case MANY_TO_MANY:
+ final ManyToMany cardinalityMtM = annotatedElement.getAnnotation(ManyToMany.class);
+ edmNaviProperty.setOnDelete(edmOnDelete != null ? edmOnDelete : setJPAOnDelete(cardinalityMtM.cascade()));
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ private void determinePartner() throws ODataJPAModelException {
+ if (sourceType instanceof IntermediateEntityType) {
+ // Partner Attribute must not be defined at Complex Types.
+ // JPA bi-directional associations are defined at both sides, e.g.
+ // at the BusinessPartner and at the Roles. JPA only defines the
+ // "mappedBy" at the Parent.
+ if (mappedBy.isPresent()) {
+ partner = targetType.getAssociation(mappedBy.get());
+ edmNaviProperty.setPartner(partner.getExternalName());
+ } else {
+ partner = targetType.getCorrespondingAssociation(sourceType, getInternalName());
+ if (partner != null
+ && ((IntermediateNavigationProperty>) partner).isMapped()) {
+ edmNaviProperty.setPartner(partner.getExternalName());
+ }
+ }
+ if (LOGGER.isTraceEnabled())
+ LOGGER.trace(getExternalName() + ": Found partner = " + partnerToString());
+ }
+ }
+
+ private Optional determineReferentialConstraint(
+ final IntermediateJoinColumn intermediateColumn) throws ODataJPAModelException, ODataJPAModelIgnoreException {
+
+ final CsdlReferentialConstraint constraint = new CsdlReferentialConstraint();
+ boolean ignore = false;
+ IntermediateModelElement p = null;
+ p = sourceType.getPropertyByDBField(intermediateColumn.getName());
+ if (p != null) {
+ if (p.ignore())
+ ignore = true;
+ constraint.setProperty(p.getExternalName());
+ p = targetType.getPropertyByDBField(intermediateColumn.getReferencedColumnName());
+ if (p != null) {
+ if (p.ignore())
+ ignore = true;
+ constraint.setReferencedProperty(p.getExternalName());
+ } else {
+ throw new ODataJPAModelException(REFERENCED_PROPERTY_NOT_FOUND, getInternalName(), intermediateColumn
+ .getReferencedColumnName(), targetType.getExternalName());
+ }
+ } else {
+ if (targetType.getPropertyByDBField(intermediateColumn.getReferencedColumnName()) != null) {
+ LOGGER.trace("Cloud not determine referential constraint for " + this.getType().getName() + "#"
+ + getInternalName());
+ throw new ODataJPAModelIgnoreException();
+ } else
+ return Optional.empty();
+ }
+ if (ignore)
+ throw new ODataJPAModelIgnoreException();
+ return Optional.of(constraint);
+ }
+
+ private void determineReferentialConstraints(final AnnotatedElement annotatedElement) throws ODataJPAModelException {
+
+ final AssociationOverride overwrite = annotatedElement.getAnnotation(AssociationOverride.class);
+ if (overwrite != null || joinTable != null)
+ return;
+
+ final List constraints = edmNaviProperty.getReferentialConstraints();
+ constraints.clear();
+ boolean ignore = false;
+ for (final IntermediateJoinColumn intermediateColumn : joinColumns) {
+ try {
+ Optional constraint = determineReferentialConstraint(intermediateColumn);
+ if (!constraint.isPresent())
+ constraint = determineReverseReferentialConstraint(intermediateColumn);
+ constraints.add(constraint.orElseThrow(
+ () -> new ODataJPAModelException(REFERENCED_PROPERTY_NOT_FOUND, getInternalName(), intermediateColumn
+ .getReferencedColumnName(), sourceType.getExternalName())));
+ } catch (final ODataJPAModelIgnoreException e) {
+ ignore = true;
+ }
+ }
+ if (ignore)
+ constraints.clear();
+ }
+
+ private Optional determineReverseReferentialConstraint(
+ final IntermediateJoinColumn intermediateColumn) throws ODataJPAModelException, ODataJPAModelIgnoreException {
+
+ final CsdlReferentialConstraint constraint = new CsdlReferentialConstraint();
+ boolean ignore = false;
+ IntermediateModelElement p = null;
+ p = sourceType.getPropertyByDBField(intermediateColumn.getReferencedColumnName());
+ if (p != null) {
+ if (p.ignore())
+ ignore = true;
+ constraint.setProperty(p.getExternalName());
+ p = targetType.getPropertyByDBField(intermediateColumn.getName());
+ if (p != null) {
+ if (p.ignore())
+ ignore = true;
+ constraint.setReferencedProperty(p.getExternalName());
+ } else {
+ // Target not found: system will fallback to default column names, no referential constraint can be given
+ LOGGER.trace("Cloud not determine referential constraint for " + this.getType().getName() + "#"
+ + getInternalName());
+ throw new ODataJPAModelIgnoreException();
+ }
+ } else {
+ return Optional.empty();
+ }
+ if (ignore)
+ throw new ODataJPAModelIgnoreException();
+ return Optional.of(constraint);
+ }
+
+ private String fillMissingName() throws ODataJPAModelException {
+ return ((IntermediateSimpleProperty) ((IntermediateEntityType>) targetType)
+ .getKey().get(0)).getDBFieldName();
+ }
+
+ private void fillMissingName(final boolean isSourceOne, final IntermediateJoinColumn intermediateColumn)
+ throws ODataJPAModelException {
+
+ final String referencedColumnName = intermediateColumn.getReferencedColumnName();
+ final String name = intermediateColumn.getName();
+
+ if (isSourceOne && (name == null || name.isEmpty()))
+ intermediateColumn.setName(((IntermediateSimpleProperty) ((IntermediateEntityType>) sourceType)
+ .getKey().get(0)).getDBFieldName());
+ else if (isSourceOne && (referencedColumnName == null || referencedColumnName.isEmpty()))
+ intermediateColumn.setReferencedColumnName(((IntermediateSimpleProperty) ((IntermediateEntityType>) targetType)
+ .getKey().get(0)).getDBFieldName());
+ else if (!isSourceOne && (referencedColumnName == null || referencedColumnName.isEmpty()))
+ intermediateColumn.setName(((IntermediateSimpleProperty) ((IntermediateEntityType>) targetType)
+ .getKey().get(0)).getDBFieldName());
+ else if (!isSourceOne && (name == null || name.isEmpty()))
+ intermediateColumn.setReferencedColumnName(((IntermediateSimpleProperty) ((IntermediateEntityType>) sourceType)
+ .getKey().get(0)).getDBFieldName());
+ }
+
+ private List invertJoinColumns(final List joinColumns) {
+ final List invertedJoinColumns = new ArrayList<>(joinColumns.size());
+ for (final IntermediateJoinColumn joinColumn : joinColumns) {
+ invertedJoinColumns.add(
+ new IntermediateJoinColumn(joinColumn.getReferencedColumnName(), joinColumn.getName()));
+ }
+ return invertedJoinColumns;
+ }
+
+ private CsdlOnDelete setJPAOnDelete(final CascadeType[] cascades) {
+ for (final CascadeType cascade : cascades) {
+ if (cascade == CascadeType.REMOVE || cascade == CascadeType.ALL) {
+ final CsdlOnDelete onDelete = new CsdlOnDelete();
+ onDelete.setAction(CsdlOnDeleteAction.Cascade);
+ return onDelete;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationFactory.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationFactory.java
index c1b1561e9..8aeb273af 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationFactory.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationFactory.java
@@ -19,21 +19,16 @@
*
* @param Type of operation
*/
-public abstract class IntermediateOperationFactory {
+interface IntermediateOperationFactory {
- IntermediateOperationFactory() {
- super();
- }
-
- abstract O createOperation(final JPAEdmNameBuilder nameBuilder, final IntermediateSchema schema,
+ O createOperation(final JPAEdmNameBuilder nameBuilder, final IntermediateSchema schema,
final Method method, final Object functionDescription)
throws ODataJPAModelException;
@SuppressWarnings("unchecked")
- Map createOperationMap(final JPAEdmNameBuilder nameBuilder, final Reflections reflections,
+ default Map createOperationMap(final JPAEdmNameBuilder nameBuilder, final Reflections reflections,
final IntermediateSchema schema, final Class extends ODataOperation> clazz,
- final Class extends Annotation> annotation)
- throws ODataJPAModelException {
+ final Class extends Annotation> annotation) throws ODataJPAModelException {
final Map operations = new HashMap<>();
if (reflections != null) {
@@ -45,7 +40,7 @@ Map createOperationMap(final JPAEdmNameBuilder nameBuilder, final Ref
return operations;
}
- Set> findJavaOperations(final Reflections reflections,
+ default Set> findJavaOperations(final Reflections reflections,
final Class clazz) {
return reflections.getSubTypesOf(clazz);
}
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationHelper.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationHelper.java
index f59a886f0..bccdf18e7 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationHelper.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationHelper.java
@@ -14,7 +14,7 @@
import java.util.Arrays;
import java.util.Collection;
-import javax.persistence.EntityManager;
+import jakarta.persistence.EntityManager;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
@@ -24,7 +24,6 @@
import com.sap.olingo.jpa.metadata.api.JPARequestParameterMap;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmFunction.ReturnType;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
-import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys;
public class IntermediateOperationHelper {
@@ -74,7 +73,9 @@ private static void checkConstructorParameter(final Method javaOperation, fi
static boolean isCollection(final Class> declaredReturnType) {
for (final Class> inter : Arrays.asList(declaredReturnType.getInterfaces())) {
- if (inter == Collection.class)
+ if (inter == Collection.class) {
+ return true;
+ } else if (isCollection(inter))
return true;
}
return false;
@@ -102,7 +103,7 @@ static FullQualifiedName determineReturnType(final ReturnType definedReturnType,
throw new ODataJPAModelException(FUNC_RETURN_TYPE_INVALID, definedReturnType.type().getName(),
declaredReturnType.getName(), operationName);
}
- return edmType.getFullQualifiedName();
+ return edmType.getFullQualifiedName();
}
}
}
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateProperty.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateProperty.java
index fff63c9e2..aa70fb803 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateProperty.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateProperty.java
@@ -21,17 +21,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.stream.Collectors;
-
-import javax.persistence.AttributeConverter;
-import javax.persistence.Column;
-import javax.persistence.Convert;
-import javax.persistence.EntityManager;
-import javax.persistence.Lob;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.Attribute.PersistentAttributeType;
-import javax.persistence.metamodel.ManagedType;
-import javax.persistence.metamodel.Type.PersistenceType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -65,6 +54,16 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.IntermediatePropertyAccess;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.Lob;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.Attribute.PersistentAttributeType;
+import jakarta.persistence.metamodel.ManagedType;
+import jakarta.persistence.metamodel.Type.PersistenceType;
+
/**
* Properties can be classified by two different aspects:
*
@@ -81,7 +80,7 @@ abstract class IntermediateProperty extends IntermediateModelElement implements
private static final int UPPER_LIMIT_PRECISION_TEMP = 12;
private static final int LOWER_LIMIT_PRECISION_TEMP = 0;
private static final String DB_FIELD_NAME_PATTERN = "\"&1\"";
- protected final Attribute, ?> jpaAttribute;
+ protected final jakarta.persistence.metamodel.Attribute, ?> jpaAttribute;
protected final IntermediateSchema schema;
protected CsdlProperty edmProperty;
protected JPAStructuredType type;
@@ -581,7 +580,7 @@ private void determineFieldGroups() {
final EdmVisibleFor jpaFieldGroups = ((AnnotatedElement) this.jpaAttribute.getJavaMember())
.getAnnotation(EdmVisibleFor.class);
if (jpaFieldGroups != null)
- fieldGroups = Arrays.stream(jpaFieldGroups.value()).collect(Collectors.toList());
+ fieldGroups = Arrays.stream(jpaFieldGroups.value()).toList();
else
fieldGroups = new ArrayList<>(0);
}
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSchema.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSchema.java
index 2f797d397..9d378b5ea 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSchema.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSchema.java
@@ -10,11 +10,6 @@
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.EmbeddableType;
-import javax.persistence.metamodel.EntityType;
-import javax.persistence.metamodel.Metamodel;
-import javax.persistence.metamodel.PluralAttribute;
import org.apache.olingo.commons.api.edm.EdmEnumType;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
@@ -30,6 +25,12 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAStructuredType;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.EmbeddableType;
+import jakarta.persistence.metamodel.EntityType;
+import jakarta.persistence.metamodel.Metamodel;
+import jakarta.persistence.metamodel.PluralAttribute;
+
/**
*
* For details about Schema metadata see:
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateServiceDocument.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateServiceDocument.java
index 42e0b3681..d2b67930f 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateServiceDocument.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateServiceDocument.java
@@ -8,7 +8,6 @@
import java.util.Optional;
import javax.annotation.CheckForNull;
-import javax.persistence.metamodel.Metamodel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -46,6 +45,8 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPATopLevelEntity;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.metamodel.Metamodel;
+
/**
* http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/schemas/edmx.xsd
* A Service Document can contain multiple schemas, but only
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSimpleProperty.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSimpleProperty.java
index 311e2bf3f..eeb435cef 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSimpleProperty.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSimpleProperty.java
@@ -9,12 +9,6 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
-import javax.persistence.Column;
-import javax.persistence.Version;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.Attribute.PersistentAttributeType;
-import javax.persistence.metamodel.SingularAttribute;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
@@ -23,6 +17,12 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEdmNameBuilder;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.Column;
+import jakarta.persistence.Version;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.Attribute.PersistentAttributeType;
+import jakarta.persistence.metamodel.SingularAttribute;
+
/**
* A Property is described on the one hand by its Name and Type and on the other
* hand by its Property Facets. The type is a qualified name of either a
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredType.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredType.java
index a26f98514..7e33fed2d 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredType.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredType.java
@@ -4,13 +4,13 @@
import static com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys.DB_TYPE_NOT_DETERMINED;
import static com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys.INVALID_NAVIGATION_PROPERTY;
import static com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException.MessageKeys.PROPERTY_REQUIRED_UNKNOWN;
-import static javax.persistence.metamodel.Attribute.PersistentAttributeType.BASIC;
-import static javax.persistence.metamodel.Attribute.PersistentAttributeType.ELEMENT_COLLECTION;
-import static javax.persistence.metamodel.Attribute.PersistentAttributeType.EMBEDDED;
-import static javax.persistence.metamodel.Attribute.PersistentAttributeType.MANY_TO_MANY;
-import static javax.persistence.metamodel.Attribute.PersistentAttributeType.MANY_TO_ONE;
-import static javax.persistence.metamodel.Attribute.PersistentAttributeType.ONE_TO_MANY;
-import static javax.persistence.metamodel.Attribute.PersistentAttributeType.ONE_TO_ONE;
+import static jakarta.persistence.metamodel.Attribute.PersistentAttributeType.BASIC;
+import static jakarta.persistence.metamodel.Attribute.PersistentAttributeType.ELEMENT_COLLECTION;
+import static jakarta.persistence.metamodel.Attribute.PersistentAttributeType.EMBEDDED;
+import static jakarta.persistence.metamodel.Attribute.PersistentAttributeType.MANY_TO_MANY;
+import static jakarta.persistence.metamodel.Attribute.PersistentAttributeType.MANY_TO_ONE;
+import static jakarta.persistence.metamodel.Attribute.PersistentAttributeType.ONE_TO_MANY;
+import static jakarta.persistence.metamodel.Attribute.PersistentAttributeType.ONE_TO_ONE;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
@@ -32,23 +32,6 @@
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
-import javax.persistence.AssociationOverride;
-import javax.persistence.AssociationOverrides;
-import javax.persistence.AttributeOverride;
-import javax.persistence.AttributeOverrides;
-import javax.persistence.Column;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToMany;
-import javax.persistence.Version;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.Attribute.PersistentAttributeType;
-import javax.persistence.metamodel.IdentifiableType;
-import javax.persistence.metamodel.ManagedType;
-import javax.persistence.metamodel.MappedSuperclassType;
-import javax.persistence.metamodel.PluralAttribute;
-import javax.persistence.metamodel.SingularAttribute;
-import javax.persistence.metamodel.Type;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -75,6 +58,24 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAStructuredType;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.AssociationOverride;
+import jakarta.persistence.AssociationOverrides;
+import jakarta.persistence.AttributeOverride;
+import jakarta.persistence.AttributeOverrides;
+import jakarta.persistence.Column;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Version;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.Attribute.PersistentAttributeType;
+import jakarta.persistence.metamodel.IdentifiableType;
+import jakarta.persistence.metamodel.ManagedType;
+import jakarta.persistence.metamodel.MappedSuperclassType;
+import jakarta.persistence.metamodel.PluralAttribute;
+import jakarta.persistence.metamodel.SingularAttribute;
+import jakarta.persistence.metamodel.Type;
+
abstract class IntermediateStructuredType extends IntermediateModelElement implements JPAStructuredType,
ODataAnnotatable {
//
@@ -408,7 +409,7 @@ void addTransientProperties() throws ODataJPAModelException {
.map(Class::getDeclaredFields)
.map(Arrays::asList)
.flatMap(List::stream)
- .collect(Collectors.toList()));
+ .toList());
}
void addVirtualProperties() throws ODataJPAModelException {
@@ -603,8 +604,7 @@ private void convertToProperty(final Attribute, ?> jpaAttribute) throws ODataJ
final PersistentAttributeType attributeType = jpaAttribute.getPersistentAttributeType();
switch (attributeType) {
- case BASIC:
- case EMBEDDED:
+ case BASIC, EMBEDDED:
if (jpaAttribute instanceof SingularAttribute, ?>
&& ((SingularAttribute, ?>) jpaAttribute).isId()
&& attributeType == PersistentAttributeType.EMBEDDED) {
@@ -681,9 +681,8 @@ private List extends JPAJoinColumn> determineJoinColumns(final IntermediateMod
@SuppressWarnings("unchecked")
private List> determineMappedSuperclass(final ManagedType managedType) {
- if (managedType instanceof IdentifiableType>) {
+ if (managedType instanceof IdentifiableType> type) {
final List> result = new ArrayList<>();
- IdentifiableType> type = (IdentifiableType) managedType;
while (type.getSupertype() instanceof MappedSuperclassType>) {
type = type.getSupertype();
result.add((MappedSuperclassType super T>) type);
@@ -1125,9 +1124,8 @@ protected static class TransientRowType implements Type {
* @param attribute
*/
public TransientRowType(final Field attribute, final IntermediateSchema schema) {
- if (attribute.getGenericType() instanceof ParameterizedType) {
- final java.lang.reflect.Type[] attributes = ((ParameterizedType) attribute.getGenericType())
- .getActualTypeArguments();
+ if (attribute.getGenericType() instanceof final ParameterizedType type) {
+ final java.lang.reflect.Type[] attributes = type.getActualTypeArguments();
this.rowType = (Class>) attributes[attributes.length - 1];
} else {
this.rowType = attribute.getType();
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateVirtualProperty.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateVirtualProperty.java
index aa09718ad..cd9ee63ed 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateVirtualProperty.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateVirtualProperty.java
@@ -1,13 +1,14 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
import javax.annotation.Nonnull;
-import javax.persistence.metamodel.Attribute;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEdmNameBuilder;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.metamodel.Attribute;
+
class IntermediateVirtualProperty extends IntermediateProperty {
IntermediateVirtualProperty(final JPAEdmNameBuilder nameBuilder, final Attribute, ?> jpaAttribute,
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAAssociationPathImpl.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAAssociationPathImpl.java
index 638bc31f5..76459f024 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAAssociationPathImpl.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAAssociationPathImpl.java
@@ -5,7 +5,6 @@
import java.util.List;
import javax.annotation.Nonnull;
-import javax.persistence.metamodel.Attribute.PersistentAttributeType;
import com.sap.olingo.jpa.metadata.api.JPAJoinColumn;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationAttribute;
@@ -18,6 +17,8 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAStructuredType;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.metamodel.Attribute.PersistentAttributeType;
+
final class JPAAssociationPathImpl implements JPAAssociationPath {
private final String alias;
private final List pathElements;
@@ -53,7 +54,7 @@ final class JPAAssociationPathImpl implements JPAAssociationPath {
pathElementsBuffer.add(attribute);
pathElementsBuffer.addAll(associationPath.getPath());
- alias = buildNaviPropertyBindingName(associationPath, attribute);
+ alias = buildNavigationPropertyBindingName(associationPath, attribute);
this.sourceType = source;
this.targetType = (IntermediateStructuredType>) associationPath.getTargetType();
if (joinColumns.isEmpty())
@@ -101,8 +102,8 @@ public String getAlias() {
@Override
public List getInverseLeftJoinColumnsList() throws ODataJPAModelException {
final List result = new ArrayList<>();
- if (joinTable instanceof IntermediateJoinTable)
- for (final IntermediateJoinColumn column : ((IntermediateJoinTable) joinTable).buildInverseJoinColumns()) {
+ if (joinTable instanceof final IntermediateJoinTable intermediateJoinTable)
+ for (final IntermediateJoinColumn column : intermediateJoinTable.buildInverseJoinColumns()) {
result.add(targetType.getPathByDBField(column.getName()));
}
return result;
@@ -246,7 +247,8 @@ private List extends JPAJoinColumn> getJoinColumns() {
*/
// TODO respect subtype name
@Nonnull
- private String buildNaviPropertyBindingName(final JPAAssociationPath associationPath, final JPAAttribute parent) {
+ private String buildNavigationPropertyBindingName(final JPAAssociationPath associationPath,
+ final JPAAttribute parent) {
final StringBuilder name = new StringBuilder();
name.append(parent.getExternalName());
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPADefaultEdmNameBuilder.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPADefaultEdmNameBuilder.java
index 510985d94..599d01d04 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPADefaultEdmNameBuilder.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPADefaultEdmNameBuilder.java
@@ -1,15 +1,14 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
-import java.util.Objects;
-
import javax.annotation.Nonnull;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.EmbeddableType;
-import javax.persistence.metamodel.EntityType;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEdmNameBuilder;
-public final class JPADefaultEdmNameBuilder implements JPAEdmNameBuilder {
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.EmbeddableType;
+import jakarta.persistence.metamodel.EntityType;
+
+public final record JPADefaultEdmNameBuilder(@Nonnull String namespace) implements JPAEdmNameBuilder {
private static final int DISTANCE_NEXT_TO_LAST_CHAR = 2;
private static final int DISTANCE_LAST_CHAR = 1;
// V2 NameBuilder: package org.apache.olingo.odata2.jpa.processor.core.access.model
@@ -24,15 +23,9 @@ public static String firstToUpper(final String jpaAttributeName) {
return Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1);
}
- private final String namespace;
-
- public JPADefaultEdmNameBuilder(@Nonnull final String namespace) {
- super();
- this.namespace = Objects.requireNonNull(namespace);
- }
-
/**
- * EDM Complex Type Name - RULE:
+ * EDM Complex Type Name - RULE:
+ *
* Use JPA Embeddable Type Simple Name as Complex Type Name
*/
@Override
@@ -41,7 +34,8 @@ public final String buildComplexTypeName(final EmbeddableType> jpaEmbeddedType
}
/**
- * EDM EntityContainer Name - RULE:
+ * EDM EntityContainer Name - RULE:
+ *
* The Entity Container Name is build of EDM Namespace + Literal "Container". Container names are simple identifiers,
* so contain only letter, digits and underscores. However namespaces
* can contain also dots => eliminate dots and convert to camel case.
@@ -58,7 +52,8 @@ public String buildContainerName() {
}
/**
- * EDM EntitySet Name - RULE:
+ * EDM EntitySet Name - RULE:
+ *
* Use plural of entity type name. The naming bases on the assumption that English nouns are used.
* Entity Set Name = JPA Entity Type Name + Literal "s"
*/
@@ -76,7 +71,8 @@ public final String buildEntitySetName(final String entityTypeName) {
}
/**
- * EDM EntityType Name - RULE:
+ * EDM EntityType Name - RULE:
+ *
* Use JPA Entity Name as EDM Entity Type Name
*/
@Override
@@ -90,7 +86,8 @@ public final String getNamespace() {
}
/**
- * EDM Navigation Property Name - RULE:
+ * EDM Navigation Property Name - RULE:
+ *
* OData requires: "The name of the navigation property MUST be unique
* within the set of structural and navigation properties of the containing
* structured type and any of its base types."
@@ -104,7 +101,8 @@ public final String buildNaviPropertyName(final Attribute, ?> jpaAttribute) {
}
/**
- * EDM Property Name - RULE:
+ * EDM Property Name - RULE:
+ *
* OData Property Names are represented in Camel Case. The first character
* of JPA Attribute Name is converted to an UpperCase Character.
* @param jpaAttributeName
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPANameBuilder.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPANameBuilder.java
index ec89aa95d..df86b7a80 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPANameBuilder.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPANameBuilder.java
@@ -1,6 +1,6 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
-import javax.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.Attribute;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAPathImpl.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAPathImpl.java
index 290ab3fd9..52fab616d 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAPathImpl.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAPathImpl.java
@@ -146,9 +146,10 @@ public String toString() {
private List determineFieldGroups() throws ODataJPAModelException {
List groups = null;
for (final JPAElement pathElement : pathElements) {
- if (pathElement instanceof IntermediateProperty && ((IntermediateProperty) pathElement).isPartOfGroup()) {
+ if (pathElement instanceof final IntermediateProperty intermediateProperty
+ && intermediateProperty.isPartOfGroup()) {
if (groups == null)
- groups = ((IntermediateProperty) pathElement).getGroups();
+ groups = intermediateProperty.getGroups();
else {
final List newGroups = ((IntermediateProperty) pathElement).getGroups();
if (groups.size() != newGroups.size() || !groups.stream().allMatch(newGroups::contains))
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAServiceDocumentFactory.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAServiceDocumentFactory.java
index 1aefe00ad..7a5e36e0e 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAServiceDocumentFactory.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAServiceDocumentFactory.java
@@ -2,14 +2,14 @@
import java.util.List;
-import javax.persistence.metamodel.Metamodel;
-
import com.sap.olingo.jpa.metadata.api.JPAEdmMetadataPostProcessor;
import com.sap.olingo.jpa.metadata.core.edm.extension.vocabularies.AnnotationProvider;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEdmNameBuilder;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAServiceDocument;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.metamodel.Metamodel;
+
public final class JPAServiceDocumentFactory {
private final JPAEdmNameBuilder nameBuilder;
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPATypeConverter.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPATypeConverter.java
index 4bbd357ad..2354160df 100644
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPATypeConverter.java
+++ b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPATypeConverter.java
@@ -15,17 +15,17 @@
import java.util.Set;
import java.util.UUID;
-import javax.persistence.Lob;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.metamodel.Attribute;
-
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.geo.Geospatial.Dimension;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmGeospatial;
import com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException;
+import jakarta.persistence.Lob;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.persistence.metamodel.Attribute;
+
/**
* This class holds utility methods for type conversions between JPA Java types and OData Types.
*
diff --git a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/reuse/OffsetDateTimeConverter.java b/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/reuse/OffsetDateTimeConverter.java
deleted file mode 100644
index b73758f5b..000000000
--- a/jpa/odata-jpa-metadata/src/main/java/com/sap/olingo/jpa/metadata/reuse/OffsetDateTimeConverter.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.sap.olingo.jpa.metadata.reuse;
-
-import java.time.OffsetDateTime;
-import java.time.ZonedDateTime;
-
-import javax.persistence.AttributeConverter;
-
-/**
- * Default converter to convert from {@link java.time.OffsetDateTime} to {@link java.time.ZonedDateTime}. This is
- * required, as Olingo 4.7.1 only supports ZonedDateTime, where as JPA 2.2 supports OffsetDateTime.
- * @author Oliver Grande
- * Created: 09.03.2020
- *
- */
-
-public class OffsetDateTimeConverter implements AttributeConverter {
- @Override
- public OffsetDateTime convertToDatabaseColumn(final ZonedDateTime zonedDateTime) {
- return zonedDateTime == null ? null : zonedDateTime.toOffsetDateTime();
- }
-
- @Override
- public ZonedDateTime convertToEntityAttribute(final OffsetDateTime dateTimeWithOffset) {
- return dateTimeWithOffset == null ? null : dateTimeWithOffset.toZonedDateTime();
- }
-
-}
diff --git a/jpa/odata-jpa-metadata/src/main/resources/metadata-exceptions-i18n.properties b/jpa/odata-jpa-metadata/src/main/resources/metadata-exceptions-i18n.properties
index 3a8fb758e..763d3155e 100644
--- a/jpa/odata-jpa-metadata/src/main/resources/metadata-exceptions-i18n.properties
+++ b/jpa/odata-jpa-metadata/src/main/resources/metadata-exceptions-i18n.properties
@@ -98,4 +98,5 @@ ODataJPAModelException.ON_LEFT_ATTRIBUTE_NULL = ON condition left attribute is n
ODataJPAModelException.ON_RIGHT_ATTRIBUTE_NULL = ON condition right attribute is null / not found.
ODataJPAModelException.DB_TYPE_NOT_DETERMINED = Type of column could not be determined for association '%1$s' of '%2$s'.
-ODataJPAModelException.FILE_NOT_FOUND = File with file path '%1$s' not found.
\ No newline at end of file
+ODataJPAModelException.FILE_NOT_FOUND = File with file path '%1$s' not found.
+ODataJPAModelException.MISSING_ONE_TO_ONE_ANNOTATION = Association '%1$s' of '%2$s' requires a cardinality annotation.
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/api/JPAEdmProviderTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/api/JPAEdmProviderTest.java
index b2131ec39..74aa4ede6 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/api/JPAEdmProviderTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/api/JPAEdmProviderTest.java
@@ -13,9 +13,10 @@
import java.util.Collections;
import java.util.List;
-import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
+import jakarta.persistence.EntityManagerFactory;
+
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlAction;
import org.apache.olingo.commons.api.edm.provider.CsdlActionImport;
@@ -345,7 +346,7 @@ private FullQualifiedName buildContainerFQN() {
return fqn;
}
- private class PostProcessor extends JPAEdmMetadataPostProcessor {
+ private class PostProcessor implements JPAEdmMetadataPostProcessor {
@Override
public void processNavigationProperty(final IntermediateNavigationPropertyAccess property,
final String jpaManagedTypeClassName) {}
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/CustomJPANameBuilder.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/CustomJPANameBuilder.java
index ef25a6700..ddc69fabb 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/CustomJPANameBuilder.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/CustomJPANameBuilder.java
@@ -1,13 +1,13 @@
/**
- *
+ *
*/
package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
import java.util.stream.IntStream;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.EmbeddableType;
-import javax.persistence.metamodel.EntityType;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.EmbeddableType;
+import jakarta.persistence.metamodel.EntityType;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEdmNameBuilder;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateActionFactoryTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateActionFactoryTest.java
index 20c408df7..56eab0276 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateActionFactoryTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateActionFactoryTest.java
@@ -38,8 +38,8 @@ void setUp() throws ODataJPAModelException {
@Test
void checkReturnEmptyMapIfReflectionsNull() throws ODataJPAModelException {
- final Reflections r = null;
- assertNotNull(cut.create(new JPADefaultEdmNameBuilder(PUNIT_NAME), r, helper.schema));
+ final Reflections reflections = null;
+ assertNotNull(cut.create(new JPADefaultEdmNameBuilder(PUNIT_NAME), reflections, helper.schema));
}
@Test
@@ -77,6 +77,6 @@ void checkReturnMapWithWithOverloadedActions() throws ODataJPAModelException {
javaActions.add(ActionWithOverload.class);
final Map act = cut.create(new JPADefaultEdmNameBuilder(
PUNIT_NAME), reflections, helper.schema);
- assertEquals(2, act.size());
+ assertEquals(3, act.size());
}
}
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateCollectionPropertyTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateCollectionPropertyTest.java
index 7d806ab81..b6f881915 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateCollectionPropertyTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateCollectionPropertyTest.java
@@ -13,11 +13,11 @@
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.metamodel.Attribute.PersistentAttributeType;
-import javax.persistence.metamodel.ManagedType;
-import javax.persistence.metamodel.PluralAttribute;
-import javax.persistence.metamodel.PluralAttribute.CollectionType;
-import javax.persistence.metamodel.Type.PersistenceType;
+import jakarta.persistence.metamodel.Attribute.PersistentAttributeType;
+import jakarta.persistence.metamodel.ManagedType;
+import jakarta.persistence.metamodel.PluralAttribute;
+import jakarta.persistence.metamodel.PluralAttribute.CollectionType;
+import jakarta.persistence.metamodel.Type.PersistenceType;
import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
@@ -69,7 +69,7 @@ void setup() throws ODataJPAModelException {
void checkSimpleCollectionPropertyType() throws ODataJPAModelException {
when(jpaAttribute.getName()).thenReturn("Text");
@SuppressWarnings("rawtypes")
- final javax.persistence.metamodel.Type type = mock(javax.persistence.metamodel.Type.class);
+ final jakarta.persistence.metamodel.Type type = mock(jakarta.persistence.metamodel.Type.class);
when(type.getPersistenceType()).thenReturn(PersistenceType.BASIC);
when(type.getJavaType()).thenAnswer(new Answer>() {
@Override
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateComplexTypeTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateComplexTypeTest.java
index ec8f400ba..28de9e6b6 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateComplexTypeTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateComplexTypeTest.java
@@ -14,7 +14,7 @@
import java.util.List;
import java.util.Set;
-import javax.persistence.metamodel.EmbeddableType;
+import jakarta.persistence.metamodel.EmbeddableType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
@@ -335,7 +335,7 @@ public Class> answer(final InvocationOnMock invocation) throws Throwable {
assertNull(ct.getBaseType());
}
- private class PostProcessorSetIgnore extends JPAEdmMetadataPostProcessor {
+ private class PostProcessorSetIgnore implements JPAEdmMetadataPostProcessor {
@Override
public void processProperty(final IntermediatePropertyAccess property, final String jpaManagedTypeClassName) {
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateContainerTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateContainerTest.java
index c6c24f6e7..4cec044be 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateContainerTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateContainerTest.java
@@ -10,7 +10,7 @@
import java.util.List;
import java.util.Set;
-import javax.persistence.metamodel.EntityType;
+import jakarta.persistence.metamodel.EntityType;
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet;
@@ -292,7 +292,7 @@ void checkReturnEntitySetBasedOnInternalEntityType() throws ODataJPAModelExcepti
}
- private class PostProcessorSetIgnore extends JPAEdmMetadataPostProcessor {
+ private class PostProcessorSetIgnore implements JPAEdmMetadataPostProcessor {
@Override
public void processProperty(final IntermediatePropertyAccess property, final String jpaManagedTypeClassName) {
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateDescriptionPropertyTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateDescriptionPropertyTest.java
index 8fb1db4b7..1c61c63f9 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateDescriptionPropertyTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateDescriptionPropertyTest.java
@@ -17,10 +17,10 @@
import java.util.Collections;
import java.util.List;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.EmbeddableType;
-import javax.persistence.metamodel.EntityType;
-import javax.persistence.metamodel.ManagedType;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.EmbeddableType;
+import jakarta.persistence.metamodel.EntityType;
+import jakarta.persistence.metamodel.ManagedType;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
@@ -393,7 +393,7 @@ void checkPathHasJoinTableNull() throws ODataJPAModelException {
assertNull(act.getJoinTable());
}
- private class PostProcessorSetName extends JPAEdmMetadataPostProcessor {
+ private class PostProcessorSetName implements JPAEdmMetadataPostProcessor {
@Override
public void processProperty(final IntermediatePropertyAccess property, final String jpaManagedTypeClassName) {
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEmbeddedIdPropertyTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEmbeddedIdPropertyTest.java
index 5c54ed533..dabd50d91 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEmbeddedIdPropertyTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEmbeddedIdPropertyTest.java
@@ -8,8 +8,8 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.EntityType;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.EntityType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntitySetTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntitySetTest.java
index becc53c08..22f04af53 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntitySetTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntitySetTest.java
@@ -17,8 +17,8 @@
import java.util.Map;
import java.util.Set;
-import javax.persistence.Entity;
-import javax.persistence.metamodel.EntityType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.metamodel.EntityType;
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet;
@@ -208,7 +208,7 @@ private void createAnnotation() {
.thenReturn(annotations);
}
- private class PostProcessor extends JPAEdmMetadataPostProcessor {
+ private class PostProcessor implements JPAEdmMetadataPostProcessor {
@Override
public void processProperty(final IntermediatePropertyAccess property, final String jpaManagedTypeClassName) {
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntityTypeTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntityTypeTest.java
index 97be9681e..a0d59ba9b 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntityTypeTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateEntityTypeTest.java
@@ -21,8 +21,8 @@
import java.util.Map;
import java.util.Optional;
-import javax.persistence.Table;
-import javax.persistence.metamodel.EntityType;
+import jakarta.persistence.Table;
+import jakarta.persistence.metamodel.EntityType;
import org.apache.olingo.commons.api.edm.EdmProperty;
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
@@ -43,6 +43,7 @@
import com.sap.olingo.jpa.metadata.core.edm.extension.vocabularies.ODataPathNotFoundException;
import com.sap.olingo.jpa.metadata.core.edm.extension.vocabularies.ODataPropertyPath;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationAttribute;
+import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationPath;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAttribute;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAOnConditionItem;
@@ -54,7 +55,6 @@
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.IntermediateNavigationPropertyAccess;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.IntermediatePropertyAccess;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.IntermediateReferenceList;
-import com.sap.olingo.jpa.processor.core.errormodel.SingletonAsEntitySet;
import com.sap.olingo.jpa.processor.core.errormodel.TeamWithTransientError;
import com.sap.olingo.jpa.processor.core.testmodel.ABCClassification;
import com.sap.olingo.jpa.processor.core.testmodel.AdministrativeDivision;
@@ -227,6 +227,18 @@ void checkGetAssociationOfComplexTypeByNameJoinColumns() throws ODataJPAModelExc
assertEquals(3, actCount, "Not all join columns found");
}
+ @Test
+ void checkGetAssociationOfMappedByWithVirtualProperty() throws ODataJPAModelException {
+
+ final IntermediateStructuredType et = new IntermediateEntityType<>(
+ new JPADefaultEdmNameBuilder(PUNIT_NAME), getEntityType(AssociationOneToOneSource.class), schema);
+ final JPAAssociationPath act = et.getAssociationPath("DefaultTarget");
+ assertEquals(1, act.getJoinColumnsList().size());
+ final JPAOnConditionItem actColumn = act.getJoinColumnsList().get(0);
+ assertEquals("ID", actColumn.getRightPath().getAlias());
+ assertEquals("Defaulttarget_id", actColumn.getLeftPath().getAlias());
+ }
+
@Test
void checkGetPropertiesSkipIgnored() throws ODataJPAModelException {
final PostProcessorSetIgnore postProcessorDouble = new PostProcessorSetIgnore();
@@ -705,14 +717,6 @@ void checkAsSingletonReturnsFalseIfTypeIsNotAnnotated() {
assertFalse(et.asSingleton());
}
- @Test
- void checkAsSingletonErrorOnAsEntitySet() throws ODataJPAModelException {
- final EntityType jpaEt = errorEmf.getMetamodel().entity(SingletonAsEntitySet.class);
- final IntermediateEntityType et = new IntermediateEntityType<>(new JPADefaultEdmNameBuilder(
- ERROR_PUNIT), jpaEt, errorSchema);
- assertThrows(ODataJPAModelException.class, () -> et.getEdmItem());
- }
-
@Test
void checkAnnotatedAsEntityType() {
final IntermediateEntityType et = new IntermediateEntityType<>(new JPADefaultEdmNameBuilder(
@@ -1105,7 +1109,7 @@ private void assertInherited(final List act) {
fail("Inherited not found");
}
- private static class PostProcessorSetIgnore extends JPAEdmMetadataPostProcessor {
+ private static class PostProcessorSetIgnore implements JPAEdmMetadataPostProcessor {
@Override
public void processProperty(final IntermediatePropertyAccess property, final String jpaManagedTypeClassName) {
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinTableTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinTableTest.java
index 4a28d8ca3..48ba6edd1 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinTableTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateJoinTableTest.java
@@ -8,9 +8,9 @@
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.JoinTable;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.EntityType;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.EntityType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateNavigationPropertyTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateNavigationPropertyTest.java
index ee81d377a..6ad08462a 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateNavigationPropertyTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateNavigationPropertyTest.java
@@ -20,10 +20,10 @@
import java.util.HashSet;
import java.util.List;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.EmbeddableType;
-import javax.persistence.metamodel.EntityType;
-import javax.persistence.metamodel.ManagedType;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.EmbeddableType;
+import jakarta.persistence.metamodel.EntityType;
+import jakarta.persistence.metamodel.ManagedType;
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
import org.apache.olingo.commons.api.edm.provider.CsdlOnDelete;
@@ -947,7 +947,7 @@ public Class> answer(final InvocationOnMock invocation) throws Throwable {
return jpaAttribute;
}
- private class PostProcessorSetName extends JPAEdmMetadataPostProcessor {
+ private class PostProcessorSetName implements JPAEdmMetadataPostProcessor {
@Override
public void processNavigationProperty(final IntermediateNavigationPropertyAccess property,
final String jpaManagedTypeClassName) {
@@ -971,7 +971,7 @@ public void processEntityType(final IntermediateEntityTypeAccess entity) {}
public void provideReferences(final IntermediateReferenceList references) throws ODataJPAModelException {}
}
- private class PostProcessorOneDelete extends JPAEdmMetadataPostProcessor {
+ private class PostProcessorOneDelete implements JPAEdmMetadataPostProcessor {
@Override
public void processNavigationProperty(final IntermediateNavigationPropertyAccess property,
final String jpaManagedTypeClassName) {
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationHelperTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationHelperTest.java
new file mode 100644
index 000000000..7f76f6ac1
--- /dev/null
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateOperationHelperTest.java
@@ -0,0 +1,32 @@
+package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Stream;
+
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import com.sap.olingo.jpa.metadata.core.edm.mapper.testobjects.TestActionCollection;
+
+class IntermediateOperationHelperTest {
+ static Stream provideIsCollection() {
+ return Stream.of(
+ Arguments.of(ArrayList.class, true),
+ Arguments.of(List.class, true),
+ Arguments.of(TestActionCollection.class, true),
+ Arguments.of(Integer.class, false),
+ Arguments.of(HashMap.class, false),
+ Arguments.of(IntermediateProperty.class, false));
+ }
+
+ @ParameterizedTest
+ @MethodSource("provideIsCollection")
+ void testIsCollection(final Class> clazz, final boolean expected) {
+ assertEquals(expected, IntermediateOperationHelper.isCollection(clazz));
+ }
+}
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateReferencesTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateReferencesTest.java
index 558ce4e49..1c5ac86e5 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateReferencesTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateReferencesTest.java
@@ -257,7 +257,7 @@ void checkAddReferenceWithURIRethrowsException() throws URISyntaxException, ODat
assertNotNull(act.getCause());
}
- class PostProcessor extends JPAEdmMetadataPostProcessor {
+ class PostProcessor implements JPAEdmMetadataPostProcessor {
@Override
public void processNavigationProperty(final IntermediateNavigationPropertyAccess property,
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSchemaTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSchemaTest.java
index 830ecb056..2b078d10c 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSchemaTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSchemaTest.java
@@ -14,8 +14,8 @@
import java.util.Collections;
import java.util.HashSet;
-import javax.persistence.metamodel.EntityType;
-import javax.persistence.metamodel.Metamodel;
+import jakarta.persistence.metamodel.EntityType;
+import jakarta.persistence.metamodel.Metamodel;
import org.apache.olingo.commons.api.edm.EdmEnumType;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSimplePropertyTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSimplePropertyTest.java
index 7e00e4ab3..49d146787 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSimplePropertyTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSimplePropertyTest.java
@@ -33,12 +33,12 @@
import java.util.List;
import java.util.Map;
-import javax.persistence.Column;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.Attribute.PersistentAttributeType;
-import javax.persistence.metamodel.EmbeddableType;
-import javax.persistence.metamodel.ManagedType;
-import javax.persistence.metamodel.SingularAttribute;
+import jakarta.persistence.Column;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.Attribute.PersistentAttributeType;
+import jakarta.persistence.metamodel.EmbeddableType;
+import jakarta.persistence.metamodel.ManagedType;
+import jakarta.persistence.metamodel.SingularAttribute;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.geo.Geospatial.Dimension;
@@ -1027,7 +1027,7 @@ private Column createDummyColumn() {
return jpaColumn;
}
- private class PostProcessorSetName extends JPAEdmMetadataPostProcessor {
+ private class PostProcessorSetName implements JPAEdmMetadataPostProcessor {
@Override
public void processProperty(final IntermediatePropertyAccess property, final String jpaManagedTypeClassName) {
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSingletonTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSingletonTest.java
index 27db8f24f..95ffb24bc 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSingletonTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateSingletonTest.java
@@ -16,7 +16,7 @@
import java.util.List;
import java.util.Map;
-import javax.persistence.Entity;
+import jakarta.persistence.Entity;
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
import org.apache.olingo.commons.api.edm.provider.CsdlSingleton;
@@ -200,7 +200,7 @@ private void createAnnotation() {
.thenReturn(annotations);
}
- private class PostProcessor extends JPAEdmMetadataPostProcessor {
+ private class PostProcessor implements JPAEdmMetadataPostProcessor {
@Override
public void processProperty(final IntermediatePropertyAccess property, final String jpaManagedTypeClassName) {
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredTypeTransientPluralAttributeTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredTypeTransientPluralAttributeTest.java
index 553d5cbc9..21f88c0a5 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredTypeTransientPluralAttributeTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredTypeTransientPluralAttributeTest.java
@@ -12,8 +12,8 @@
import java.util.Map;
import java.util.Set;
-import javax.persistence.metamodel.ManagedType;
-import javax.persistence.metamodel.PluralAttribute.CollectionType;
+import jakarta.persistence.metamodel.ManagedType;
+import jakarta.persistence.metamodel.PluralAttribute.CollectionType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DynamicTest;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredTypeVirtualAttributeTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredTypeVirtualAttributeTest.java
index 126c58645..704fa1d26 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredTypeVirtualAttributeTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateStructuredTypeVirtualAttributeTest.java
@@ -1,12 +1,12 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.impl;
-import static javax.persistence.metamodel.Attribute.PersistentAttributeType.BASIC;
+import static jakarta.persistence.metamodel.Attribute.PersistentAttributeType.BASIC;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.mock;
-import javax.persistence.metamodel.ManagedType;
+import jakarta.persistence.metamodel.ManagedType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateVirtualPropertyTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateVirtualPropertyTest.java
index 9034ea032..3daa30ac9 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateVirtualPropertyTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateVirtualPropertyTest.java
@@ -12,8 +12,8 @@
import java.util.ArrayList;
import java.util.Arrays;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.ManagedType;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.ManagedType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DynamicTest;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateWrongAnnotationTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateWrongAnnotationTest.java
index 5aef46cfc..419f09fbe 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateWrongAnnotationTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/IntermediateWrongAnnotationTest.java
@@ -14,10 +14,10 @@
import java.util.ArrayList;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.EntityType;
-import javax.persistence.metamodel.PluralAttribute;
+import jakarta.persistence.EntityManagerFactory;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.EntityType;
+import jakarta.persistence.metamodel.PluralAttribute;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAQueryExtensionProviderTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAQueryExtensionProviderTest.java
index 97926e6e4..c0175a3ea 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAQueryExtensionProviderTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPAQueryExtensionProviderTest.java
@@ -7,9 +7,9 @@
import java.util.List;
import java.util.Map;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Expression;
-import javax.persistence.criteria.From;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Expression;
+import jakarta.persistence.criteria.From;
import org.junit.jupiter.api.Test;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPATypeConverterTest.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPATypeConverterTest.java
index 76d78248c..3aa1f151d 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPATypeConverterTest.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/JPATypeConverterTest.java
@@ -24,10 +24,10 @@
import java.util.UUID;
import java.util.stream.Stream;
-import javax.persistence.Lob;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.metamodel.Attribute;
+import jakarta.persistence.Lob;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.persistence.metamodel.Attribute;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.geo.Geospatial.Dimension;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/TestHelper.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/TestHelper.java
index b830350b5..f72133c11 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/TestHelper.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/TestHelper.java
@@ -9,13 +9,13 @@
import java.util.HashSet;
import java.util.List;
-import javax.persistence.metamodel.Attribute;
-import javax.persistence.metamodel.EmbeddableType;
-import javax.persistence.metamodel.EntityType;
-import javax.persistence.metamodel.ManagedType;
-import javax.persistence.metamodel.Metamodel;
-import javax.persistence.metamodel.PluralAttribute;
-import javax.persistence.metamodel.SingularAttribute;
+import jakarta.persistence.metamodel.Attribute;
+import jakarta.persistence.metamodel.EmbeddableType;
+import jakarta.persistence.metamodel.EntityType;
+import jakarta.persistence.metamodel.ManagedType;
+import jakarta.persistence.metamodel.Metamodel;
+import jakarta.persistence.metamodel.PluralAttribute;
+import jakarta.persistence.metamodel.SingularAttribute;
import org.reflections8.Reflections;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/TestMappingRoot.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/TestMappingRoot.java
index feddc4067..fb6b78e92 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/TestMappingRoot.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/impl/TestMappingRoot.java
@@ -2,8 +2,8 @@
import java.util.Set;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.metamodel.EntityType;
+import jakarta.persistence.EntityManagerFactory;
+import jakarta.persistence.metamodel.EntityType;
import org.junit.jupiter.api.BeforeAll;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testaction/ActionWithOverload.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testaction/ActionWithOverload.java
index 98abbfb58..c0908dd0c 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testaction/ActionWithOverload.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testaction/ActionWithOverload.java
@@ -1,12 +1,13 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.testaction;
-import javax.persistence.EntityManager;
+import jakarta.persistence.EntityManager;
import com.sap.olingo.jpa.metadata.api.JPAHttpHeaderMap;
import com.sap.olingo.jpa.metadata.api.JPARequestParameterMap;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmAction;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmParameter;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.ODataAction;
+import com.sap.olingo.jpa.processor.core.testmodel.AdministrativeDivision;
import com.sap.olingo.jpa.processor.core.testmodel.BusinessPartner;
import com.sap.olingo.jpa.processor.core.testmodel.Person;
@@ -26,4 +27,9 @@ public void baseAction(@EdmParameter(name = "Binding") final BusinessPartner par
public void overloadedAction(@EdmParameter(name = "Binding") final Person partner) {
}
+
+ @EdmAction(name = "DoSometingFunny", isBound = true)
+ public void overloadedAction(@EdmParameter(name = "Binding") final AdministrativeDivision partner) {
+
+ }
}
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testaction/Actions.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testaction/Actions.java
index 7365b121f..416f73e22 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testaction/Actions.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testaction/Actions.java
@@ -2,7 +2,7 @@
import java.math.BigDecimal;
-import javax.persistence.EntityManager;
+import jakarta.persistence.EntityManager;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmAction;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmParameter;
@@ -16,15 +16,15 @@ public Actions(final EntityManager em) {
@EdmAction(name = "BoundNoImport", isBound = true)
public void boundNoImport(
- @EdmParameter(name = "Person") Person person,
- @EdmParameter(name = "A", precision = 34, scale = 10) BigDecimal a) {
+ @EdmParameter(name = "Person") final Person person,
+ @EdmParameter(name = "A", precision = 34, scale = 10) final BigDecimal a) {
// Do nothing
}
@EdmAction(name = "WithImport", isBound = false)
public void withImport(
- @EdmParameter(name = "Person") Person person,
- @EdmParameter(name = "A", precision = 34, scale = 10) BigDecimal a) {
+ @EdmParameter(name = "Person") final Person person,
+ @EdmParameter(name = "A", precision = 34, scale = 10) final BigDecimal a) {
// Do nothing
}
}
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ConverterWithConstructorError.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ConverterWithConstructorError.java
index 096ac2c36..ca96a1473 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ConverterWithConstructorError.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ConverterWithConstructorError.java
@@ -1,6 +1,6 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.testobjects;
-import javax.persistence.AttributeConverter;
+import jakarta.persistence.AttributeConverter;
public class ConverterWithConstructorError implements AttributeConverter[], Integer> {
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleFunctionForFilter.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleFunctionForFilter.java
index a5aeea3a8..b6088d531 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleFunctionForFilter.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleFunctionForFilter.java
@@ -2,8 +2,8 @@
import java.time.LocalDate;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.From;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.From;
import com.sap.olingo.jpa.metadata.api.JPAODataQueryContext;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmFunction;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaEmConstructor.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaEmConstructor.java
index 92210370f..8d9fc23d6 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaEmConstructor.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaEmConstructor.java
@@ -1,27 +1,27 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.testobjects;
-import javax.persistence.EntityManager;
+import jakarta.persistence.EntityManager;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmAction;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmFunction;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmFunction.ReturnType;
+import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmParameter;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.ODataAction;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.ODataFunction;
-import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmParameter;
public class ExampleJavaEmConstructor implements ODataFunction, ODataAction {
- public ExampleJavaEmConstructor(EntityManager em) {
+ public ExampleJavaEmConstructor(final EntityManager em) {
super();
}
@EdmFunction(name = "", returnType = @ReturnType)
public Integer sum(
- @EdmParameter(name = "A") short a, @EdmParameter(name = "B") int b) {
+ @EdmParameter(name = "A") final short a, @EdmParameter(name = "B") final int b) {
return a + b;
}
@EdmAction(name = "")
public void mul(
- @EdmParameter(name = "A") short a, @EdmParameter(name = "B") int b) {}
+ @EdmParameter(name = "A") final short a, @EdmParameter(name = "B") final int b) {}
}
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaPrivateConstructor.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaPrivateConstructor.java
index d5e7978d1..a83effe28 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaPrivateConstructor.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaPrivateConstructor.java
@@ -1,27 +1,27 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.testobjects;
-import javax.persistence.EntityManager;
+import jakarta.persistence.EntityManager;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmAction;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmFunction;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmFunction.ReturnType;
+import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmParameter;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.ODataAction;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.ODataFunction;
-import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmParameter;
public class ExampleJavaPrivateConstructor implements ODataFunction, ODataAction {
- private ExampleJavaPrivateConstructor(EntityManager em) {
+ private ExampleJavaPrivateConstructor(final EntityManager em) {
super();
}
@EdmFunction(name = "", returnType = @ReturnType)
public Integer sum(
- @EdmParameter(name = "A") short a, @EdmParameter(name = "B") int b) {
+ @EdmParameter(name = "A") final short a, @EdmParameter(name = "B") final int b) {
return a + b;
}
@EdmAction(name = "")
public void mul(
- @EdmParameter(name = "A") short a, @EdmParameter(name = "B") int b) {}
+ @EdmParameter(name = "A") final short a, @EdmParameter(name = "B") final int b) {}
}
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaTwoParameterConstructor.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaTwoParameterConstructor.java
index 0d05d82b6..55ef3c26c 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaTwoParameterConstructor.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/ExampleJavaTwoParameterConstructor.java
@@ -1,27 +1,27 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.testobjects;
-import javax.persistence.EntityManager;
+import jakarta.persistence.EntityManager;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmAction;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmFunction;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmFunction.ReturnType;
+import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmParameter;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.ODataAction;
import com.sap.olingo.jpa.metadata.core.edm.mapper.extension.ODataFunction;
-import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmParameter;
public class ExampleJavaTwoParameterConstructor implements ODataFunction, ODataAction {
- public ExampleJavaTwoParameterConstructor(EntityManager em, Integer a) {
+ public ExampleJavaTwoParameterConstructor(final EntityManager em, final Integer a) {
super();
}
@EdmFunction(name = "", returnType = @ReturnType)
public Integer sum(
- @EdmParameter(name = "A") short a, @EdmParameter(name = "B") int b) {
+ @EdmParameter(name = "A") final short a, @EdmParameter(name = "B") final int b) {
return a + b;
}
@EdmAction(name = "")
public void mul(
- @EdmParameter(name = "A") short a, @EdmParameter(name = "B") int b) {}
+ @EdmParameter(name = "A") final short a, @EdmParameter(name = "B") final int b) {}
}
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/FileAccessConverter.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/FileAccessConverter.java
index b1a59fc65..ec8cfb6f2 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/FileAccessConverter.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/FileAccessConverter.java
@@ -4,21 +4,21 @@
import java.util.Arrays;
import java.util.List;
-import javax.persistence.AttributeConverter;
+import jakarta.persistence.AttributeConverter;
public class FileAccessConverter implements AttributeConverter {
@Override
- public Short convertToDatabaseColumn(FileAccess[] attributes) {
+ public Short convertToDatabaseColumn(final FileAccess[] attributes) {
return attributes[0].getValue();
}
@Override
- public FileAccess[] convertToEntityAttribute(Short dbData) {
+ public FileAccess[] convertToEntityAttribute(final Short dbData) {
if (dbData == null)
return null;
final List accesses = new ArrayList<>();
- for (FileAccess e : Arrays.asList(FileAccess.values())) {
+ for (final FileAccess e : Arrays.asList(FileAccess.values())) {
if (e.getValue() == dbData)
accesses.add(e);
}
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/TestActionCollection.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/TestActionCollection.java
new file mode 100644
index 000000000..007429033
--- /dev/null
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/TestActionCollection.java
@@ -0,0 +1,7 @@
+package com.sap.olingo.jpa.metadata.core.edm.mapper.testobjects;
+
+import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAction;
+
+public interface TestActionCollection extends TestCollectionInterface, JPAAction {
+
+}
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/TestCollectionInterface.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/TestCollectionInterface.java
new file mode 100644
index 000000000..206a66474
--- /dev/null
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/TestCollectionInterface.java
@@ -0,0 +1,8 @@
+package com.sap.olingo.jpa.metadata.core.edm.mapper.testobjects;
+
+import java.io.Serializable;
+import java.util.Collection;
+
+public interface TestCollectionInterface extends Serializable, Collection {
+
+}
\ No newline at end of file
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongFunctionConstructor.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongFunctionConstructor.java
index 1aab0fa7a..d522a3def 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongFunctionConstructor.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongFunctionConstructor.java
@@ -1,6 +1,6 @@
package com.sap.olingo.jpa.metadata.core.edm.mapper.testobjects;
-import javax.persistence.EntityManager;
+import jakarta.persistence.EntityManager;
import com.sap.olingo.jpa.metadata.api.JPAODataQueryContext;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmFunction;
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongMemberConverter.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongMemberConverter.java
index 7d2d23189..a1f9437d8 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongMemberConverter.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongMemberConverter.java
@@ -4,21 +4,21 @@
import java.util.Arrays;
import java.util.List;
-import javax.persistence.AttributeConverter;
+import jakarta.persistence.AttributeConverter;
public class WrongMemberConverter implements AttributeConverter {
@Override
- public Integer convertToDatabaseColumn(WrongMember[] attributes) {
+ public Integer convertToDatabaseColumn(final WrongMember[] attributes) {
return attributes[0].getValue();
}
@Override
- public WrongMember[] convertToEntityAttribute(Integer dbData) {
+ public WrongMember[] convertToEntityAttribute(final Integer dbData) {
if (dbData == null)
return null;
final List accesses = new ArrayList<>();
- for (WrongMember e : Arrays.asList(WrongMember.values())) {
+ for (final WrongMember e : Arrays.asList(WrongMember.values())) {
if (e.getValue() == dbData)
accesses.add(e);
}
diff --git a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongTypeConverter.java b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongTypeConverter.java
index 5cc1af983..6beffe555 100644
--- a/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongTypeConverter.java
+++ b/jpa/odata-jpa-metadata/src/test/java/com/sap/olingo/jpa/metadata/core/edm/mapper/testobjects/WrongTypeConverter.java
@@ -2,17 +2,17 @@
import java.math.BigDecimal;
-import javax.persistence.AttributeConverter;
+import jakarta.persistence.AttributeConverter;
public class WrongTypeConverter implements AttributeConverter {
@Override
- public BigDecimal convertToDatabaseColumn(WrongType[] attribute) {
+ public BigDecimal convertToDatabaseColumn(final WrongType[] attribute) {
return WrongType.TEST.getValue();
}
@Override
- public WrongType[] convertToEntityAttribute(BigDecimal dbData) {
+ public WrongType[] convertToEntityAttribute(final BigDecimal dbData) {
return new WrongType[] { WrongType.TEST };
}
diff --git a/jpa/odata-jpa-odata-vocabularies/pom.xml b/jpa/odata-jpa-odata-vocabularies/pom.xml
index 34b8b160b..33f52f9a4 100644
--- a/jpa/odata-jpa-odata-vocabularies/pom.xml
+++ b/jpa/odata-jpa-odata-vocabularies/pom.xml
@@ -3,7 +3,7 @@
com.sap.olingoodata-jpa
- 1.1.1
+ 2.0.0odata-jpa-odata-vocabulariesodata-jpa-odata-vocabularies
@@ -33,19 +33,19 @@
org.junit.jupiterjunit-jupiter
- 5.9.1
+ ${junit.version}testorg.junit.platformjunit-platform-launcher
- 1.9.1
+ ${junit-platform.version}testorg.mockitomockito-core
- 3.6.0
+ ${mockito.version}test
diff --git a/jpa/odata-jpa-odata-vocabularies/src/main/java/com/sap/olingo/jpa/metadata/odata/v4/provider/JavaBasedODataAnnotationsProvider.java b/jpa/odata-jpa-odata-vocabularies/src/main/java/com/sap/olingo/jpa/metadata/odata/v4/provider/JavaBasedODataAnnotationsProvider.java
index 49c15d3d5..774d25181 100644
--- a/jpa/odata-jpa-odata-vocabularies/src/main/java/com/sap/olingo/jpa/metadata/odata/v4/provider/JavaBasedODataAnnotationsProvider.java
+++ b/jpa/odata-jpa-odata-vocabularies/src/main/java/com/sap/olingo/jpa/metadata/odata/v4/provider/JavaBasedODataAnnotationsProvider.java
@@ -2,13 +2,10 @@
import static java.util.Objects.requireNonNull;
-import java.lang.annotation.Annotation;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Collection;
-import java.util.Map;
import java.util.Objects;
-import java.util.stream.Collectors;
import javax.annotation.Nonnull;
@@ -19,7 +16,6 @@
import com.sap.olingo.jpa.metadata.core.edm.extension.vocabularies.JPAReferences;
import com.sap.olingo.jpa.metadata.core.edm.extension.vocabularies.ODataAnnotatable;
import com.sap.olingo.jpa.metadata.core.edm.extension.vocabularies.ODataVocabularyReadException;
-import com.sap.olingo.jpa.metadata.core.edm.extension.vocabularies.ReferenceAccess;
import com.sap.olingo.jpa.metadata.core.edm.extension.vocabularies.ReferenceList;
abstract class JavaBasedODataAnnotationsProvider implements AnnotationProvider {
@@ -36,7 +32,7 @@ abstract class JavaBasedODataAnnotationsProvider implements AnnotationProvider {
public Collection getAnnotations(@Nonnull final Applicability appliesTo,
final ODataAnnotatable annotatable, final JPAReferences references) {
- final Map annotations = requireNonNull(annotatable).javaAnnotations(packageName);
+ final var annotations = requireNonNull(annotatable).javaAnnotations(packageName);
return requireNonNull(references).getTerms(getAlias(), requireNonNull(appliesTo)).stream()
.map(term -> annotations.get(term.getName()))
@@ -44,15 +40,15 @@ public Collection getAnnotations(@Nonnull final Applicability ap
.map(a -> converter.convert(references, a, annotatable))
.map(converted -> converted.orElse(null))
.filter(Objects::nonNull)
- .collect(Collectors.toList());
+ .toList();
}
@Override
public void addReferences(final ReferenceList references) throws ODataVocabularyReadException {
try {
- final URI uri = getUri();
- final ReferenceAccess reference = references.addReference(uri, getPath());
+ final var uri = getUri();
+ final var reference = references.addReference(uri, getPath());
reference.addInclude(getNameSpace(), getAlias());
} catch (final URISyntaxException e) {
throw new ODataVocabularyReadException(getAlias(), getPath(), e);
diff --git a/jpa/odata-jpa-processor-cb/README.md b/jpa/odata-jpa-processor-cb/README.md
index 4af4bd846..7de885fbd 100644
--- a/jpa/odata-jpa-processor-cb/README.md
+++ b/jpa/odata-jpa-processor-cb/README.md
@@ -30,4 +30,4 @@ SELECT "CodePublisher", "CodeID", "DivisionCode", "CountryISOCode", "Area", "Pop
are not supported. This type of queries are quite handy for client side or service driven paging.
-This project contains an implementation of a set of interfaces from `javax.persistence.criteria.*` to enable the creation queries like mentioned above. This implementation is used if it is part of the build path or in other words if it can be found by the class loader.
\ No newline at end of file
+This project contains an implementation of a set of interfaces from `jakarta.persistence.criteria.*` to enable the creation queries like mentioned above. This implementation is used if it is part of the build path or in other words if it can be found by the class loader.
\ No newline at end of file
diff --git a/jpa/odata-jpa-processor-cb/pom.xml b/jpa/odata-jpa-processor-cb/pom.xml
index 11b0c0176..43bfcaa58 100644
--- a/jpa/odata-jpa-processor-cb/pom.xml
+++ b/jpa/odata-jpa-processor-cb/pom.xml
@@ -5,7 +5,7 @@
com.sap.olingoodata-jpa
- 1.1.1
+ 2.0.0odata-jpa-processor-cb
@@ -35,7 +35,7 @@
org.springframeworkspring-jcl
- 5.2.4.RELEASE
+ ${spring-jcl.version}
diff --git a/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/api/EntityManagerFactoryWrapper.java b/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/api/EntityManagerFactoryWrapper.java
index f0f402f2e..b136bf793 100644
--- a/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/api/EntityManagerFactoryWrapper.java
+++ b/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/api/EntityManagerFactoryWrapper.java
@@ -2,15 +2,15 @@
import java.util.Map;
-import javax.persistence.Cache;
-import javax.persistence.EntityGraph;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceUnitUtil;
-import javax.persistence.Query;
-import javax.persistence.SynchronizationType;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.metamodel.Metamodel;
+import jakarta.persistence.Cache;
+import jakarta.persistence.EntityGraph;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.EntityManagerFactory;
+import jakarta.persistence.PersistenceUnitUtil;
+import jakarta.persistence.Query;
+import jakarta.persistence.SynchronizationType;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.metamodel.Metamodel;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAServiceDocument;
import com.sap.olingo.jpa.processor.cb.impl.EntityManagerWrapper;
@@ -48,7 +48,9 @@ public EntityManager createEntityManager(final SynchronizationType synchronizati
@Override
public CriteriaBuilder getCriteriaBuilder() {
- return new EntityManagerWrapper(emf.createEntityManager(), sd).getCriteriaBuilder();
+ try (EntityManager em = new EntityManagerWrapper(emf.createEntityManager(), sd)) {
+ return em.getCriteriaBuilder();
+ }
}
@Override
@@ -87,8 +89,8 @@ public void addNamedQuery(final String name, final Query query) {
}
@Override
- public T unwrap(final Class cls) {
- return emf.unwrap(cls);
+ public T unwrap(final Class clazz) {
+ return emf.unwrap(clazz);
}
@Override
diff --git a/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/AbstractJoinImp.java b/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/AbstractJoinImp.java
index 3f95ae74c..cd2cbf7b1 100644
--- a/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/AbstractJoinImp.java
+++ b/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/AbstractJoinImp.java
@@ -4,11 +4,12 @@
import java.util.Optional;
import javax.annotation.Nonnull;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Expression;
-import javax.persistence.criteria.From;
-import javax.persistence.criteria.Join;
-import javax.persistence.criteria.Predicate;
+
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Expression;
+import jakarta.persistence.criteria.From;
+import jakarta.persistence.criteria.Join;
+import jakarta.persistence.criteria.Predicate;
import com.sap.olingo.jpa.metadata.api.JPAJoinColumn;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType;
diff --git a/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CollectionJoinImpl.java b/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CollectionJoinImpl.java
index 650abcf10..2d2d3d123 100644
--- a/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CollectionJoinImpl.java
+++ b/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CollectionJoinImpl.java
@@ -3,14 +3,14 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
-import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.JoinType;
-import javax.persistence.criteria.Path;
-import javax.persistence.metamodel.Attribute;
+
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.JoinType;
+import jakarta.persistence.criteria.Path;
+import jakarta.persistence.metamodel.Attribute;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPACollectionAttribute;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType;
@@ -67,7 +67,7 @@ public StringBuilder asSQL(final StringBuilder statement) {
.getJoinTable()
.getTableName());
- tableAlias.ifPresent(p -> statement.append(" ").append(p));
+ tableAlias.ifPresent(alias -> statement.append(" ").append(alias));
statement.append(" ON ");
return ((SqlConvertible) on).asSQL(statement);
} catch (final ODataJPAModelException e) {
@@ -106,8 +106,9 @@ List getPathList() {
final JPAPath path = source.getPath(this.alias.orElse(attribute.getExternalName()));
pathList.add(path);
} else {
- pathList.addAll(attribute.getStructuredType().getPathList().stream().filter(p -> !p.ignore()).collect(Collectors
- .toList()));
+ pathList.addAll(attribute.getStructuredType().getPathList().stream()
+ .filter(path -> !path.ignore())
+ .toList());
}
} catch (final ODataJPAModelException e) {
throw new IllegalStateException(e);
@@ -138,11 +139,11 @@ public int hashCode() {
}
@Override
- public boolean equals(final Object obj) {
- if (this == obj) return true;
- if (!super.equals(obj)) return false;
- if (getClass() != obj.getClass()) return false;
- final CollectionJoinImpl, ?> other = (CollectionJoinImpl, ?>) obj;
+ public boolean equals(final Object object) {
+ if (this == object) return true;
+ if (!super.equals(object)) return false;
+ if (getClass() != object.getClass()) return false;
+ final CollectionJoinImpl, ?> other = (CollectionJoinImpl, ?>) object;
if (attribute == null) {
if (other.attribute != null) return false;
} else if (!attribute.equals(other.attribute)) return false;
diff --git a/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CompoundSelectionImpl.java b/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CompoundSelectionImpl.java
index a99573659..13e1fd0c0 100644
--- a/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CompoundSelectionImpl.java
+++ b/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CompoundSelectionImpl.java
@@ -1,7 +1,5 @@
package com.sap.olingo.jpa.processor.cb.impl;
-import static java.util.stream.Collectors.toList;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -9,8 +7,9 @@
import java.util.Optional;
import javax.annotation.Nonnull;
-import javax.persistence.criteria.CompoundSelection;
-import javax.persistence.criteria.Selection;
+
+import jakarta.persistence.criteria.CompoundSelection;
+import jakarta.persistence.criteria.Selection;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath;
import com.sap.olingo.jpa.processor.cb.ProcessorSelection;
@@ -50,7 +49,7 @@ public SqlSelection alias(@Nonnull final String name) {
public StringBuilder asSQL(@Nonnull final StringBuilder statement) {
statement.append(getCompoundSelectionItems().stream()
- .map(s -> (Selection>) s) // NOSONAR
+ .map(selection -> (Selection>) selection) // NOSONAR
.collect(new StringBuilderCollector.SelectionCollector(statement, ", ")));
return statement;
}
@@ -78,19 +77,19 @@ public List> getCompoundSelectionItems() {
}
private List> asSelectionLate() {
- final List> selItems = new ArrayList<>();
+ final List> selectionItems = new ArrayList<>();
for (final Selection> sel : rawSelections) {
if (sel instanceof PathImpl>) {
- selItems.addAll(((PathImpl>) sel)
+ selectionItems.addAll(((PathImpl>) sel)
.resolvePathElements()
.stream()
.map(element -> new SelectionImpl<>(element, element.getJavaType(), aliasBuilder))
- .collect(toList()));
+ .toList());
} else {
- selItems.add(new SelectionImpl<>(sel, sel.getJavaType(), aliasBuilder));
+ selectionItems.add(new SelectionImpl<>(sel, sel.getJavaType(), aliasBuilder));
}
}
- selections = Optional.of(selItems);
+ selections = Optional.of(selectionItems);
return selections.get();
}
@@ -115,46 +114,46 @@ public boolean isCompoundSelection() {
}
List> resolveSelectionLate() {
- final AliasBuilder ab = new AliasBuilder("S");
+ final AliasBuilder selectionAliasBuilder = new AliasBuilder("S");
final List> resolved = new ArrayList<>();
for (final Selection> sel : rawSelections) {
- resolveSelectionItem(ab, resolved, sel);
+ resolveSelectionItem(selectionAliasBuilder, resolved, sel);
}
resolvedSelection = Optional.of(resolved);
return resolvedSelection.get();
}
- private void addSelectionList(final AliasBuilder ab, final List> resolved,
- final Selection> sel) {
- for (final JPAPath p : ((PathImpl>) sel).getPathList()) {
- resolved.add(new ProcessorSelection.SelectionItem(sel.getAlias().isEmpty()
- ? ab.getNext() : (sel.getAlias() + "." + p.getAlias()), p));
+ private void addSelectionList(final AliasBuilder aliasBuilder, final List> resolved,
+ final List selectionItems, String alias) {
+ for (final JPAPath p : selectionItems) {
+ resolved.add(new ProcessorSelection.SelectionItem(alias.isEmpty()
+ ? aliasBuilder.getNext() : (alias + "." + p.getAlias()), p));
}
}
- private void addSingleSelectionItem(final AliasBuilder ab, final List> resolved,
- final Selection> sel, final List selItems) {
- resolved.add(new ProcessorSelection.SelectionItem(sel.getAlias().isEmpty()
- ? ab.getNext() : sel.getAlias(), selItems.get(0)));
+ private void addSingleSelectionItem(final AliasBuilder aliasBuilder, final List> resolved,
+ final Selection> selection, final List selectionItems) {
+ resolved.add(new ProcessorSelection.SelectionItem(selection.getAlias().isEmpty()
+ ? aliasBuilder.getNext() : selection.getAlias(), selectionItems.get(0)));
}
- private void resolveSelectionItem(final AliasBuilder ab, final List> resolved,
- final Selection> sel) {
+ private void resolveSelectionItem(final AliasBuilder aliasBuilder, final List> resolved,
+ final Selection> selection) {
- if (sel instanceof PathImpl> || sel instanceof SelectionPath>) {
- final List selItems;
- if (sel instanceof PathImpl>)
- selItems = ((PathImpl>) sel).getPathList();
+ if (selection instanceof PathImpl> || selection instanceof SelectionPath>) {
+ final List selectionItems;
+ if (selection instanceof PathImpl>)
+ selectionItems = ((PathImpl>) selection).getPathList();
else
- selItems = ((PathImpl>) ((SelectionPath>) sel).selection.getSelection()).getPathList();
- if (selItems.size() == 1) {
- addSingleSelectionItem(ab, resolved, sel, selItems);
+ selectionItems = ((PathImpl>) ((SelectionPath>) selection).selection.getSelection()).getPathList();
+ if (selectionItems.size() == 1) {
+ addSingleSelectionItem(aliasBuilder, resolved, selection, selectionItems);
} else {
- addSelectionList(ab, resolved, sel);
+ addSelectionList(aliasBuilder, resolved, selectionItems, selection.getAlias());
}
} else {
- resolved.add(new ProcessorSelection.SelectionItem(sel.getAlias().isEmpty()
- ? ab.getNext() : sel.getAlias(), new JPAPathWrapper(sel)));
+ resolved.add(new ProcessorSelection.SelectionItem(selection.getAlias().isEmpty()
+ ? aliasBuilder.getNext() : selection.getAlias(), new JPAPathWrapper(selection)));
}
}
diff --git a/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CriteriaBuilderImpl.java b/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CriteriaBuilderImpl.java
index ad04800bf..2f7ea287f 100644
--- a/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CriteriaBuilderImpl.java
+++ b/jpa/odata-jpa-processor-cb/src/main/java/com/sap/olingo/jpa/processor/cb/impl/CriteriaBuilderImpl.java
@@ -5,6 +5,9 @@
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@@ -13,25 +16,25 @@
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
-import java.util.stream.Collectors;
import javax.annotation.Nonnull;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CollectionJoin;
-import javax.persistence.criteria.CompoundSelection;
-import javax.persistence.criteria.CriteriaDelete;
-import javax.persistence.criteria.CriteriaUpdate;
-import javax.persistence.criteria.Expression;
-import javax.persistence.criteria.Join;
-import javax.persistence.criteria.ListJoin;
-import javax.persistence.criteria.MapJoin;
-import javax.persistence.criteria.Order;
-import javax.persistence.criteria.Path;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import javax.persistence.criteria.Selection;
-import javax.persistence.criteria.SetJoin;
-import javax.persistence.criteria.Subquery;
+
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CollectionJoin;
+import jakarta.persistence.criteria.CompoundSelection;
+import jakarta.persistence.criteria.CriteriaDelete;
+import jakarta.persistence.criteria.CriteriaUpdate;
+import jakarta.persistence.criteria.Expression;
+import jakarta.persistence.criteria.Join;
+import jakarta.persistence.criteria.ListJoin;
+import jakarta.persistence.criteria.MapJoin;
+import jakarta.persistence.criteria.Order;
+import jakarta.persistence.criteria.Path;
+import jakarta.persistence.criteria.Predicate;
+import jakarta.persistence.criteria.Root;
+import jakarta.persistence.criteria.Selection;
+import jakarta.persistence.criteria.SetJoin;
+import jakarta.persistence.criteria.Subquery;
import com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAServiceDocument;
import com.sap.olingo.jpa.processor.cb.ProcessorCriteriaBuilder;
@@ -58,7 +61,7 @@ class CriteriaBuilderImpl implements ProcessorCriteriaBuilder { // NOSONAR
* @return absolute value
*/
@Override
- public Expression abs(@Nonnull final Expression x) {
+ public Expression abs(@Nonnull final Expression expression) {
throw new NotImplementedException();
}
@@ -414,8 +417,7 @@ public Predicate exists(@Nonnull final Subquery> subquery) {
public Expression function(@Nonnull final String name, @Nonnull final Class type,
final Expression>... args) {
final List> parameters = args == null ? Collections.emptyList() : Arrays.asList(args).stream()
- .map(
- p -> ((Expression