├── src ├── test │ ├── resources │ │ ├── org │ │ │ └── datanucleus │ │ │ │ └── samples │ │ │ │ └── plugin │ │ │ │ ├── plugin1.xsd │ │ │ │ ├── MANIFEST0.MF │ │ │ │ ├── MANIFEST1.MF │ │ │ │ ├── MANIFEST2.MF │ │ │ │ ├── MANIFEST4.MF │ │ │ │ ├── MANIFEST1-1.MF │ │ │ │ ├── MANIFEST11.MF │ │ │ │ ├── meta-inf │ │ │ │ └── MANIFEST.MF │ │ │ │ ├── MANIFEST3.MF │ │ │ │ ├── MANIFEST10.MF │ │ │ │ ├── MANIFEST12.MF │ │ │ │ ├── MANIFEST13.MF │ │ │ │ ├── MANIFEST14.MF │ │ │ │ ├── MANIFEST15.MF │ │ │ │ ├── MANIFEST16.MF │ │ │ │ ├── MANIFEST17.MF │ │ │ │ ├── MANIFEST5.MF │ │ │ │ ├── plugin1expoint.xml │ │ │ │ ├── plugin2.xml │ │ │ │ └── plugin1.xml │ │ └── log4j.properties │ └── java │ │ └── org │ │ └── datanucleus │ │ ├── store │ │ └── query │ │ │ └── MyResultClass.java │ │ └── util │ │ ├── ConcurrentRefMapSoftValueTest.java │ │ └── ConcurrentRefMapWeakValueTest.java └── main │ ├── java │ └── org │ │ └── datanucleus │ │ ├── transaction │ │ ├── jta │ │ │ ├── package.html │ │ │ ├── JTASyncRegistryUnavailableException.java │ │ │ └── TransactionManagerLocator.java │ │ ├── package.html │ │ ├── RollbackException.java │ │ └── HeuristicMixedException.java │ │ ├── api │ │ └── package.html │ │ ├── exceptions │ │ ├── package.html │ │ ├── CommitStateTransitionException.java │ │ └── TransactionIsolationNotSupportedException.java │ │ ├── store │ │ ├── query │ │ │ ├── expression │ │ │ │ ├── package.html │ │ │ │ └── ExpressionEvaluator.java │ │ │ ├── inmemory │ │ │ │ ├── method │ │ │ │ │ ├── package.html │ │ │ │ │ ├── ExpFunction.java │ │ │ │ │ ├── LogFunction.java │ │ │ │ │ ├── CeilFunction.java │ │ │ │ │ ├── CoshFunction.java │ │ │ │ │ ├── SinhFunction.java │ │ │ │ │ ├── TanhFunction.java │ │ │ │ │ ├── CotangentFunction.java │ │ │ │ │ ├── SignFunction.java │ │ │ │ │ ├── LocalDateFunction.java │ │ │ │ │ ├── LocalTimeFunction.java │ │ │ │ │ ├── LocalDateTimeFunction.java │ │ │ │ │ ├── AbsFunction.java │ │ │ │ │ ├── CosineFunction.java │ │ │ │ │ ├── SineFunction.java │ │ │ │ │ ├── SqrtFunction.java │ │ │ │ │ ├── ArcSineFunction.java │ │ │ │ │ ├── FloorFunction.java │ │ │ │ │ ├── TangentFunction.java │ │ │ │ │ ├── ArcCosineFunction.java │ │ │ │ │ ├── ArcTangentFunction.java │ │ │ │ │ ├── DegreesFunction.java │ │ │ │ │ ├── RadiansFunction.java │ │ │ │ │ └── ArcTangent2Function.java │ │ │ │ ├── package.html │ │ │ │ ├── InMemoryFailure.java │ │ │ │ ├── JPQLResultClassMapper.java │ │ │ │ ├── JDOQLResultClassMapper.java │ │ │ │ └── NumericAggregateExpression.java │ │ │ ├── package.html │ │ │ ├── cache │ │ │ │ ├── package.html │ │ │ │ ├── StrongQueryCompilationCache.java │ │ │ │ ├── StrongQueryDatastoreCompilationCache.java │ │ │ │ ├── StrongQueryResultsCache.java │ │ │ │ ├── SoftQueryCompilationCache.java │ │ │ │ ├── SoftQueryDatastoreCompilationCache.java │ │ │ │ ├── WeakQueryDatastoreCompilationCache.java │ │ │ │ ├── SoftQueryResultsCache.java │ │ │ │ ├── WeakQueryResultsCache.java │ │ │ │ └── WeakQueryCompilationCache.java │ │ │ ├── compiler │ │ │ │ ├── package.html │ │ │ │ ├── CompilationComponent.java │ │ │ │ ├── CompilationOptimiser.java │ │ │ │ ├── Symbol.java │ │ │ │ ├── ParameterNode.java │ │ │ │ └── QueryCompilerSyntaxException.java │ │ │ ├── NullOrderingType.java │ │ │ ├── NoQueryResultsException.java │ │ │ ├── QueryInterruptedException.java │ │ │ ├── QueryInvalidParametersException.java │ │ │ ├── QueryTimeoutException.java │ │ │ └── QueryNotUniqueException.java │ │ ├── schema │ │ │ ├── table │ │ │ │ └── package.html │ │ │ ├── package.html │ │ │ ├── naming │ │ │ │ ├── package.html │ │ │ │ └── SchemaComponent.java │ │ │ ├── CurrentUserProvider.java │ │ │ ├── DefaultStoreSchemaHandler.java │ │ │ └── SchemaScriptAwareStoreManager.java │ │ ├── types │ │ │ ├── package.html │ │ │ ├── converters │ │ │ │ ├── package.html │ │ │ │ ├── MultiColumnConverter.java │ │ │ │ ├── ColumnLengthDefiningTypeConverter.java │ │ │ │ ├── CharacterStringConverter.java │ │ │ │ ├── SqlDateLongConverter.java │ │ │ │ ├── SqlTimeLongConverter.java │ │ │ │ ├── YearIntegerConverter.java │ │ │ │ ├── BooleanIntegerConverter.java │ │ │ │ ├── BigIntegerLongConverter.java │ │ │ │ ├── BooleanYNConverter.java │ │ │ │ ├── SqlDateDateConverter.java │ │ │ │ ├── SqlTimeDateConverter.java │ │ │ │ ├── StringBufferStringConverter.java │ │ │ │ ├── StringBuilderStringConverter.java │ │ │ │ ├── DurationLongConverter.java │ │ │ │ ├── InstantStringConverter.java │ │ │ │ ├── DurationStringConverter.java │ │ │ │ └── SqlTimestampLongConverter.java │ │ │ ├── scostore │ │ │ │ ├── package.html │ │ │ │ ├── SetStore.java │ │ │ │ └── Store.java │ │ │ ├── containers │ │ │ │ ├── package.html │ │ │ │ ├── SequenceAdapter.java │ │ │ │ ├── JDKMapHandler.java │ │ │ │ ├── ContainerAdapter.java │ │ │ │ ├── PropertiesHandler.java │ │ │ │ ├── TreeMapHandler.java │ │ │ │ ├── HashMapHandler.java │ │ │ │ ├── HashtableHandler.java │ │ │ │ ├── MapContainerAdapter.java │ │ │ │ ├── LinkedHashMapHandler.java │ │ │ │ ├── JDKListAdapter.java │ │ │ │ ├── TreeSetHandler.java │ │ │ │ ├── HashSetHandler.java │ │ │ │ ├── LinkedHashSetHandler.java │ │ │ │ ├── PriorityQueueHandler.java │ │ │ │ ├── ElementContainerAdapter.java │ │ │ │ └── StackHandler.java │ │ │ ├── wrappers │ │ │ │ ├── package.html │ │ │ │ └── backed │ │ │ │ │ ├── package.html │ │ │ │ │ └── BackedSCO.java │ │ │ └── SCOList.java │ │ ├── fieldmanager │ │ │ ├── package.html │ │ │ └── UnsetOwnerFieldManager.java │ │ ├── autostart │ │ │ └── package.html │ │ ├── federation │ │ │ └── package.html │ │ ├── valuegenerator │ │ │ └── package.html │ │ ├── package.html │ │ ├── ConnectionEncryptionProvider.java │ │ ├── connection │ │ │ ├── ConnectionResourceType.java │ │ │ ├── ManagedConnectionWithListenerAccess.java │ │ │ └── package.html │ │ ├── EncryptionAwareStoreManager.java │ │ └── NucleusConnection.java │ │ ├── management │ │ ├── package.html │ │ ├── ManagerStatisticsMBean.java │ │ └── ManagerStatistics.java │ │ ├── util │ │ └── package.html │ │ ├── enhancer │ │ ├── methods │ │ │ └── package.html │ │ ├── package.html │ │ └── asm │ │ │ └── package.html │ │ ├── package.html │ │ ├── metadata │ │ ├── xml │ │ │ └── package.html │ │ ├── annotations │ │ │ ├── package.html │ │ │ ├── ClassAnnotationHandler.java │ │ │ └── MemberAnnotationHandler.java │ │ ├── MetaDataListener.java │ │ ├── ColumnMetaDataContainer.java │ │ ├── MetaDataFileType.java │ │ ├── MetaDataScanner.java │ │ └── package.html │ │ ├── properties │ │ ├── package.html │ │ ├── PropertyValidator.java │ │ └── StringPropertyValidator.java │ │ ├── flush │ │ ├── package.html │ │ ├── ControlOperationQueueForBackingStoreFlushProcess.java │ │ ├── Operation.java │ │ └── SCOOperation.java │ │ ├── plugin │ │ └── package.html │ │ ├── identity │ │ ├── package.html │ │ ├── IdentityStringTranslator.java │ │ └── IdentityKeyTranslator.java │ │ ├── enhancement │ │ └── package.html │ │ ├── cache │ │ ├── EnlistedSMCacheFactory.java │ │ ├── SupportsConcurrentModificationsIteration.java │ │ └── TieredLevel1Cache.java │ │ ├── state │ │ ├── package.html │ │ └── LockMode.java │ │ ├── overview.html │ │ └── ExecutionContextListener.java │ └── resources │ ├── org │ └── datanucleus │ │ └── Localisation_es.properties │ └── META-INF │ ├── README.txt │ └── NOTICE.txt ├── .gitignore ├── .settings ├── org.eclipse.pde.core.prefs ├── org.eclipse.m2e.core.prefs ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.ui.prefs └── org.eclipse.mylyn.tasks.ui.prefs ├── .github └── ISSUE_TEMPLATE.md └── .project /src/test/resources/org/datanucleus/samples/plugin/plugin1.xsd: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | /bin 3 | /datanucleus.log 4 | /target 5 | nb-*.xml 6 | /target 7 | /*.jpage 8 | -------------------------------------------------------------------------------- /.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | BUNDLE_ROOT_PATH=target/classes 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/transaction/jta/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing handlers for JTA transactions 3 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/transaction/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing support specific to transactions for DataNucleus. 3 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/api/package.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | Provides adapters for different client APIs, like JDO, JPA and so on. 4 |

5 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/exceptions/package.html: -------------------------------------------------------------------------------- 1 | 2 | This package provides exceptions thrown by the core (client-facing) parts of DataNucleus. 3 | 4 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/expression/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing expressions from which a (generically) compiled query is made up. 3 | -------------------------------------------------------------------------------- /src/main/resources/org/datanucleus/Localisation_es.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datanucleus/datanucleus-core/HEAD/src/main/resources/org/datanucleus/Localisation_es.properties -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources/META-INF=UTF-8 4 | encoding//src/test/java=UTF-8 5 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | formatter_profile=_DataNucleus Conventions 3 | formatter_settings_version=12 4 | internal.default.compliance=default 5 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/management/package.html: -------------------------------------------------------------------------------- 1 | 2 | This package provides classes for management/monitoring of DataNucleus enabled applications via API or JMX. 3 | 4 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/util/package.html: -------------------------------------------------------------------------------- 1 | 2 | Provides utility classes used in the implementation that don't fit in a particular functional part of the system. 3 | 4 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/schema/table/package.html: -------------------------------------------------------------------------------- 1 | 2 | Provides a series of convenience classes for modelling tables and columns that a class and its members map onto. 3 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/enhancer/methods/package.html: -------------------------------------------------------------------------------- 1 | 2 | Method enhancements for supporting the org.datanucleus.enhancement.Persistable bytecode enhancement contract. 3 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing the evaluation of Java methods/functions for use by JDOQL/JPQL in-memory query evaluators. 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.mylyn.tasks.ui.prefs: -------------------------------------------------------------------------------- 1 | #Wed May 21 14:57:09 CEST 2008 2 | eclipse.preferences.version=1 3 | project.repository.kind=jira 4 | project.repository.url=http\://www.datanucleus.org/servlet/jira 5 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/package.html: -------------------------------------------------------------------------------- 1 | 2 | This package provides classes that are typically externally called, whether that means by developers 3 | or by other DataNucleus plugins. 4 | 5 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing basic java type handling for DataNucleus. 3 | TypeManager provides the entry point for accessing java type capabilities in DataNucleus. 4 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/schema/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package defining the data structure mechanism for the schema of the datastore. 3 | Should be extended/implemented by each datastore to match their own structure. 4 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/metadata/xml/package.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | Provides classes for parsing XML metadata input data and converting into org.datanucleus.metadata input data for the DataNucleus persistence process. 4 |

5 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing query language support for datastores. 3 | Classes provided here are typically extended by datastore packages to provide their own support for JDOQL, JPQL, SQL etc. 4 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/cache/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing definition of caching for queries. 3 | Defines an interface to be implemented by any plugins providing query caching. 4 | Provides some simple implementations. 5 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/metadata/annotations/package.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | Provides classes for parsing annotations input data and converting into org.datanucleus.metadata input 4 | data for the DataNucleus persistence process. 5 |

6 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/README.txt: -------------------------------------------------------------------------------- 1 | Core 2 | ==== 3 | This project is the prerequisite of any application using DataNucleus. 4 | Other DataNucleus projects depend on this project. 5 | 6 | This project is licensed by the Apache 2 license which you should have received with this. 7 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/properties/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing handling for persistence properties, and in particular the validation of valid values. 3 | All property validators have a "validate(key, value)" method called to validate the supplied value. 4 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing type conversion for member types, using the interface TypeConverter allowing 3 | conversion between some member Java type, and a Java type suitable for persistence in the datastore. 4 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST0.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST1.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test1;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST2.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test2;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST4.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test4;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST1-1.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test1;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/fieldmanager/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing managers for fields which give a mechanism for navigating through fields of a class and 3 | performing operations based on the type of the field. 4 | See PersistenceCapable.ObjectIdFieldManager in the JDO specification. 5 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST11.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test11;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | 9 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/meta-inf/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/flush/package.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | This package provides classes managing the flush process when using MANUAL flush. In this mode 4 | all operations are queued up and then flushed either by a user call to flush() or by commit() of 5 | the transaction. 6 |

7 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/plugin/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing the plugin mechanism utilised by DataNucleus. 3 | The mechanism is based around Eclipse extension points / extensions, and is usable under an OSGi environment or a basic Java environment. 4 | There is no dependency on Eclipse classes. 5 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST3.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test3;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | Require-Bundle: org.datanucleus.plugin.test4 9 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/identity/package.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | Package defining object identity classes. 4 | Provides identity classes for datastore id (single field) and application id (single field), as well as many convenience methods for 5 | accessing information out of these identity classes, and also creating them. 6 |

7 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/scostore/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing backing store definitions for (SCO) types that need a backing store. 3 | Intended to be implemented by datastore-specific stores where the datastore has a mechanism for updating 4 | such as a Collection contents itself (e.g RDBMS, storing a collection via join table or FK). 5 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/enhancement/package.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | DataNucleus ByteCode enhancement contract. 4 | This package provides all additional classes necessary for the bytecode enhancement contract used by DataNucleus. 5 | The org.datanucleus.enhancer package is responsible for modifying classes to implement this contract. 6 |

7 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing classes for supporting use of containers (collection, map, array) in DataNucleus. 3 | Provide handling in a generic way without having to embed usages of specific implementations of collections, maps etc through the codebase. 4 | See ContainerHandler and ContainerAdapter for more details. 5 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST10.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test10;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | Require-Bundle: org.datanucleus.plugin.test11;bundle-version=1.2.0.b2 9 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST12.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test12;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | Require-Bundle: org.datanucleus.plugin.test11;bundle-version=(1.2.0.b2 9 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST13.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test13;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | Require-Bundle: org.datanucleus.plugin.test11;bundle-version=(1.2.0.c1 9 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST14.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test14;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | Require-Bundle: org.datanucleus.plugin.test11;bundle-version="(1.0.0.b2,1.2.0.b2]" 9 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST15.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test15;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | Require-Bundle: org.datanucleus.plugin.test11;bundle-version="(1.0.0.b2,1.2.0.b2)" 9 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST16.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test16;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | Require-Bundle: org.datanucleus.plugin.test11;bundle-version="(1.0.0.b2,1.2.0.c1)" 9 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST17.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test17;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | Require-Bundle: org.datanucleus.plugin.test11;bundle-version="(1.0.0.b2,1.2.0.c1)" 9 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/MANIFEST5.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: DataNucleus Plugin Test 4 | Bundle-SymbolicName: org.datanucleus.plugin.test5;singleton:=true 5 | Bundle-Vendor: DataNucleus 6 | Bundle-Version: 1.2.0.b2 7 | Bundle-Localization: plugin 8 | Require-Bundle: org.datanucleus.plugin.test6,org.datanucleus.plugin.test7;resolution:=optional 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Feature Request: provide as much detail as possible about behaviour 2 | ## Bug Report, attach a testcase using [problem guide](http://www.datanucleus.org/documentation/problem_reporting.html) and state what version the problem occurs in. Any "Bug" without a testcase will be CLOSED. 3 | 4 | Please NOTE that people are strongly encouraged to CONTRIBUTE features / fixes, since this is open source software. 5 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/autostart/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing the structure and some implementation for the auto-start mechanism. 3 | This is used primarily under JDO usage where the user wants memory of the classes that were 4 | known about the previous time, or simply to make some classes known to the persistence mechanism. 5 | With JPA usage, or when using JDO with persistence.xml this is typically not needed. 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/plugin1expoint.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/schema/naming/package.html: -------------------------------------------------------------------------------- 1 | 2 | This package is a work-in-progress to provide datastore-agnostic naming strategies for JDO, JPA and 3 | indeed any other API. The idea following the what we originally did with IdentifierFactory except that 4 | this is just the name component, and we pass in a SchemaComponent defining what the name is for. 5 | It will ultimately be usable with all "store" plugins, and we'll migrate the stores across to use it. 6 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/wrappers/package.html: -------------------------------------------------------------------------------- 1 | 2 | Provides implementations of the "simple" wrappers for the mutable Second Class Objects (SCO's) supported by DataNucleus, so 3 | that we can intercept calls that will mutate the object. Please refer to section 6.3 of the JDO spec. 4 | This simple form of the SCO wrapper has a delegate and intercepts any mutating methods, marking the field as dirty. 5 | There is no "backing store" or lazy loading like in the "backed" wrapper, but this will handle cascade delete triggering 6 | 7 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/cache/EnlistedSMCacheFactory.java: -------------------------------------------------------------------------------- 1 | package org.datanucleus.cache; 2 | 3 | import org.datanucleus.state.DNStateManager; 4 | 5 | import java.util.Map; 6 | 7 | /** 8 | * Factory interface for constructing custom enlistedSMCache in ExecutionContext. 9 | */ 10 | public interface EnlistedSMCacheFactory 11 | { 12 | /** 13 | * Return new instance of enlistedSMCache used when constructing ExecutionContexts. 14 | * @return new instance of enlistedSMCache 15 | */ 16 | Map createEnlistedSMCache(); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/federation/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing management for federation of datastores. 3 | This allows us to have a PMF/EMF for multiple datastores, and to distribute any insert/update/delete/fetch to the relevant datastore. 4 | It also allows us to query across multiple datastores and federate the results. 5 |

6 | The more standard alternative to this is to have a PMF per datastore, and then to persist to whichever you want, and query whichever you want. 7 | Merging results is then left to the user. 8 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/wrappers/backed/package.html: -------------------------------------------------------------------------------- 1 | 2 | Provides implementations of the "backed" wrappers for the mutable Second Class Objects (SCO's) that are 3 | supported. All have a "backing store" allowing the contents to be sent to/retrieved from the datastore 4 | when required. Please refer to section 6.3 of the JDO 1.0 spec. 5 | Also provides queueing so that optimistic transactions can be supported when used with the backing store. 6 | All "backed" wrappers extend the basic form of the wrapper in the parent package. 7 | 8 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/valuegenerator/package.html: -------------------------------------------------------------------------------- 1 | 2 | Value Generation. 3 | This package provides a series of classes providing generation of values. 4 | The entry point is ValueGenerationManager which is used for creating and managing the 5 | various ValueGenerators. All generators are known by a symbolic name and can 6 | be accessed from the ValueGenerationManager via that name once created. All ValueGenerators 7 | copy the JDO2 "javax.jdo.datastore.Sequence" interface method names and hence 8 | can be easily extended and implement that interface. 9 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/enhancer/package.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | DataNucleus ByteCode enhancer framework. 4 | The DataNucleusEnhancer class is the typical entry point for command line usage. 5 | DataNucleus supports persistence where the persistable classes are bytecode enhanced 6 | to a particular contract to facilitate easier access to field values, and when fields are changed. 7 | The bytecode enhancement contract that is used here is based on the JDO bytecode enhancement contract, 8 | and uses ASM to perform the enhancement. 9 |

10 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/plugin2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/test/resources/org/datanucleus/samples/plugin/plugin1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package providing the evaluation of queries using an in-memory process with evaluators for JDOQL and JPQL. 3 |

4 | Contains a series of classes implementing org.datanucleus.query.inmemory.InvocationEvaluator providing support for particular functions (in JDOQL/JPQL). 5 | Contains a series of classes implementing org.datanucleus.query.inmemory.AggregateExpression providing support for aggregation of different java types. 6 | Note that the in-memory query evaluator only supports a subset of the full syntax supported by JDOQL/JPQL. For example JOINs are not supported, or some subqueries. 7 |

8 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | datanucleus-core 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.pde.PluginNature 21 | org.eclipse.m2e.core.maven2Nature 22 | org.eclipse.jdt.core.javanature 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/state/package.html: -------------------------------------------------------------------------------- 1 | 2 | Provides classes relating to the life cycle state management of a persistable object. 3 | Refer to section 5.5 of the JDO 1.0 specification for a description of this type of StateManager. 4 | 5 | The org.datanucleus.enhancement.StateManager definition of a StateManager is extended by org.datanucleus.state.DNStateManager 6 | providing the additional handling needed for participating in the persistence process. 7 | 8 | Each persistable object has a particular org.datanucleus.state.LifeCycleState and the associated states for each API allow transitioning between states 9 | using the associated methods. 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # LOG4J Configuration 2 | # =================== 3 | 4 | # Basic logging goes to "datanucleus.log" 5 | log4j.appender.A1=org.apache.log4j.FileAppender 6 | log4j.appender.A1.File=datanucleus.log 7 | log4j.appender.A1.layout=org.apache.log4j.PatternLayout 8 | log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%t) %-5p [%c] - %m%n 9 | #log4j.appender.A1.Threshold=INFO 10 | 11 | # Categories 12 | # Each category can be set to a "level", and to direct to an appender 13 | 14 | # Default to DEBUG level for all categories 15 | log4j.logger.DataNucleus = DEBUG, A1 16 | 17 | log4j.category.com.mchange.v2.c3p0=INFO, A1 18 | log4j.category.com.mchange.v2.resourcepool=INFO, A1 19 | log4j.category.org.logicalcobwebs.proxool=INFO,A1 20 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package handling the storage of classes to the datastore, and the management of the datastore. 3 | Each type of datastore will have its own subpackage (e.g org.datanucleus.store.rdbms) and its own StoreManager. 4 | When providing support for a new datastore you need to extend AbstractStoreManager. 5 |

6 | The package also provides definition of StoreData - data held about each class and utilised by 7 | the StoreManager to perform its duties. This data is populated either at runtime when classes 8 | are requested, or when using an "auto-starter". There are several auto-start mechanisms. This 9 | package has ClassesAutoStarter and XMLAutoStarter. 10 |

11 | 12 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/flush/ControlOperationQueueForBackingStoreFlushProcess.java: -------------------------------------------------------------------------------- 1 | package org.datanucleus.flush; 2 | 3 | /** 4 | * A marker interface for FlushProcess implementations to control 5 | * if org.datanucleus.ExecutionContext#flushOperationsForBackingStore 6 | * should do anything. 7 | * Some FlushProcess implementations might want to handle these 8 | * operations by them self. 9 | */ 10 | public interface ControlOperationQueueForBackingStoreFlushProcess 11 | { 12 | /** 13 | * 14 | * @return whether org.datanucleus.ExecutionContext#flushOperationsForBackingStore 15 | * should do anything or not. Return true to have it perform all operations and return 16 | * false to have it do nothing. 17 | */ 18 | boolean flushOperationQueueForBackingStore(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/compiler/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package handling the (generic) compilation of queries. 3 | Provides compilation of "string-based" queries. Provides handling for different query languages such as JDOQL and JPQL. 4 | Compilation of a string-based query goes through two steps. 5 |
    6 |
  1. Parse of the string converting each component of the query into a Node tree
  2. 7 |
  3. Compilation of the Node tree into an expression tree
  4. 8 |
9 | From this tree the evaluation process can be configured to convert it into the native query language for the datastore; this part is handled within each datastore plugin. 10 | 11 | From this tree an in-memory evaluation can be performed. This is provided in the org.datanucleus.store.query.inmemory package and subpackage(s). 12 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/overview.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | DataNucleus Access Platform is an open source java persistence system, fully implementing and fully-compliant with all JDO, JPA, Jakarta specifications. 4 | It supports persistence to many types of datastores including RDBMS, ODBMS, XML, Excel/ODF, JSON, BigTable. 5 | This project is DataNucleus "core" providing the persistence framework used by all DataNucleus sub-projects (plugins). 6 | It includes transaction handling, logging, and management of datastores, together with the basis for JDOQL/JPQL querying. 7 |

8 |

9 | Support for this persistence layer is provided by way of a free support on groups.io / Gitter or via 10 | Commercial Support from DataNucleus. 11 |

12 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/SequenceAdapter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | public interface SequenceAdapter 21 | { 22 | public abstract void update(Object newElement, int position); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/NullOrderingType.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2013 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query; 19 | 20 | /** 21 | * Enum for how to handle null values when ordering a query based on a column. 22 | */ 23 | public enum NullOrderingType 24 | { 25 | NULLS_FIRST, 26 | NULLS_LAST 27 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/enhancer/asm/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | ASM : a small and fast bytecode manipulation framework. 4 | This is repackaged from groupId="org.ow2.asm" artifactId="asm.jar" for ASM v9.8. 5 | The only changes in the code were to fix compiler warnings. 6 | 7 |

8 | The process to upgrade this "repackaged" ASM is as follows :- 9 |

    10 |
  1. Open datanucleus-core in Eclipse (or equivalent IDE)
  2. 11 |
  3. Download and open the source code for the version of ASM that you want in Eclipse
  4. 12 |
  5. Copy all files from org.objectweb.asm (but not sub-packages), and paste these into org.datanucleus.enhancer.asm
  6. 13 |
  7. Inspect all compiler warnings in Eclipse and fix the formatting of the ASM methods to avoid ALL warnings.
  8. 14 |
  9. Update package.html of org.datanucleus.enhancer.asm to mention the current version of ASM that is repackaged
  10. 15 |
  11. Update ClassEnhancer.ASM_API_VERSION if using a new version of the ASM API
  12. 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/transaction/RollbackException.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2007 Erik Bengtson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.transaction; 19 | 20 | public class RollbackException extends NucleusTransactionException 21 | { 22 | 23 | private static final long serialVersionUID = 5776212291698777821L; 24 | 25 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/transaction/HeuristicMixedException.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2007 Erik Bengtson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.transaction; 19 | 20 | public class HeuristicMixedException extends NucleusTransactionException 21 | { 22 | 23 | private static final long serialVersionUID = -5898996177613924172L; 24 | 25 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/schema/naming/SchemaComponent.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2011 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.schema.naming; 19 | 20 | /** 21 | * Enum of the types of schema components that we need to create names for. 22 | */ 23 | public enum SchemaComponent 24 | { 25 | TABLE, 26 | COLUMN, 27 | CONSTRAINT, 28 | SEQUENCE 29 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/scostore/SetStore.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2004 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | 16 | Contributors: 17 | ... 18 | **********************************************************************/ 19 | package org.datanucleus.store.types.scostore; 20 | 21 | /** 22 | * Interface representation of the backing store for a Set. 23 | */ 24 | public interface SetStore extends CollectionStore 25 | { 26 | // Add any methods specific to Set here 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/wrappers/backed/BackedSCO.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2013 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.wrappers.backed; 19 | 20 | import org.datanucleus.store.types.scostore.Store; 21 | 22 | /** 23 | * Interface implemented by backed SCOs. 24 | */ 25 | public interface BackedSCO 26 | { 27 | Store getBackingStore(); 28 | 29 | boolean isLoaded(); 30 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/compiler/CompilationComponent.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.compiler; 19 | 20 | /** 21 | * Enum defining the component of a query being compiled. 22 | */ 23 | public enum CompilationComponent 24 | { 25 | RESULT, 26 | FROM, 27 | FILTER, 28 | GROUPING, 29 | HAVING, 30 | ORDERING, 31 | UPDATE 32 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/compiler/CompilationOptimiser.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2016 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.compiler; 19 | 20 | /** 21 | * Interface to be implemented by an "optimiser" for the query compilation process. 22 | */ 23 | public interface CompilationOptimiser 24 | { 25 | /** 26 | * Method to perform the optimisation. 27 | */ 28 | void optimise(); 29 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/schema/CurrentUserProvider.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2017 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.schema; 19 | 20 | /** 21 | * Provides the current user in order to support 'CreateUser', 'UpdateUser' audit features. 22 | */ 23 | public interface CurrentUserProvider 24 | { 25 | /** 26 | * Return the current user. 27 | * @return Current user 28 | */ 29 | String currentUser(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/ExecutionContextListener.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus; 19 | 20 | /** 21 | * Listener for closure of an ExecutionContext. 22 | */ 23 | public interface ExecutionContextListener 24 | { 25 | /** 26 | * Method called when the specified ExecutionContext is closing. 27 | * @param ec The ExecutionContext 28 | */ 29 | void executionContextClosing(ExecutionContext ec); 30 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/InMemoryFailure.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory; 19 | 20 | /** 21 | * Class representing a failure in the in-memory evaluation process. 22 | * An object of this type is used where an expression evaluation results in failure 23 | * (e.g something is impossible, or something not implemented). 24 | */ 25 | public class InMemoryFailure 26 | { 27 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/JDKMapHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato Garcia and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.Map; 21 | 22 | public abstract class JDKMapHandler> extends MapHandler 23 | { 24 | @Override 25 | public MapContainerAdapter getAdapter(C container) 26 | { 27 | return new JDKMapAdapter(container); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/ContainerAdapter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | /** 21 | * An adapter for container classes allowing DN to operate on them in a generic form instead of 22 | * depending directly on the JDK containers. 23 | * @param The container class 24 | */ 25 | public interface ContainerAdapter extends Iterable 26 | { 27 | C getContainer(); 28 | 29 | void clear(); 30 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/PropertiesHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.Properties; 21 | 22 | import org.datanucleus.metadata.AbstractMemberMetaData; 23 | 24 | public class PropertiesHandler extends JDKMapHandler 25 | { 26 | @Override 27 | public Properties newContainer(AbstractMemberMetaData mmm) 28 | { 29 | return new Properties(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/TreeMapHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.TreeMap; 21 | 22 | import org.datanucleus.metadata.AbstractMemberMetaData; 23 | 24 | public class TreeMapHandler extends JDKMapHandler> 25 | { 26 | @Override 27 | public TreeMap newContainer(AbstractMemberMetaData mmm) 28 | { 29 | return new TreeMap(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/schema/DefaultStoreSchemaHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2014 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.schema; 19 | 20 | import org.datanucleus.store.StoreManager; 21 | 22 | /** 23 | * Fallback StoreSchemaHandler that simply provides access to the schema flags. 24 | */ 25 | public class DefaultStoreSchemaHandler extends AbstractStoreSchemaHandler 26 | { 27 | public DefaultStoreSchemaHandler(StoreManager storeMgr) 28 | { 29 | super(storeMgr); 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/HashMapHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.HashMap; 21 | 22 | import org.datanucleus.metadata.AbstractMemberMetaData; 23 | 24 | public class HashMapHandler extends JDKMapHandler> 25 | { 26 | @Override 27 | public HashMap newContainer(AbstractMemberMetaData mmm) 28 | { 29 | return new HashMap(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/cache/SupportsConcurrentModificationsIteration.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2024 kraendavid and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.cache; 19 | 20 | /** 21 | * Marker interface for collections where it's possible to make modifications while iterating. 22 | * When used for Level 1 cache implementations there is a considerable performance benefit 23 | * when closing an execution context with many objects in Level 1 cache. 24 | */ 25 | public interface SupportsConcurrentModificationsIteration 26 | { 27 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/schema/SchemaScriptAwareStoreManager.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2013 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.schema; 19 | 20 | /** 21 | * Interface to be implemented by all store managers that support execution of scripts on the schema. 22 | */ 23 | public interface SchemaScriptAwareStoreManager 24 | { 25 | /** 26 | * Execute the provided script on the datastore schema. 27 | * @param script The script 28 | */ 29 | void executeScript(String script); 30 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/HashtableHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato Garcia and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.Hashtable; 21 | 22 | import org.datanucleus.metadata.AbstractMemberMetaData; 23 | 24 | public class HashtableHandler extends JDKMapHandler> 25 | { 26 | @Override 27 | public Hashtable newContainer(AbstractMemberMetaData mmm) 28 | { 29 | return new Hashtable(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/MapContainerAdapter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.Map.Entry; 21 | 22 | public interface MapContainerAdapter extends ContainerAdapter 23 | { 24 | Object put(Object key, Object value); 25 | 26 | Object remove(Object key); 27 | 28 | Iterable> entries(); 29 | 30 | Iterable keys(); 31 | 32 | Iterable values(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/properties/PropertyValidator.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.properties; 19 | 20 | /** 21 | * Interface defining a validator for a DataNucleus property. 22 | */ 23 | public interface PropertyValidator 24 | { 25 | /** 26 | * Method to validate the value of this property. 27 | * @param name Name of the property 28 | * @param value The value 29 | * @return Whether it is valid 30 | */ 31 | public boolean validate(String name, Object value); 32 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/expression/ExpressionEvaluator.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Erik Bengtson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.expression; 19 | 20 | /** 21 | * Interface for an evaluator of an expression. 22 | */ 23 | public interface ExpressionEvaluator 24 | { 25 | /** 26 | * Method to evaluate the provided expression. 27 | * @param expr Expression to evaluate 28 | * @return Evaluation of the expression 29 | */ 30 | Object evaluate(Expression expr); 31 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/LinkedHashMapHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.LinkedHashMap; 21 | 22 | import org.datanucleus.metadata.AbstractMemberMetaData; 23 | 24 | public class LinkedHashMapHandler extends JDKMapHandler> 25 | { 26 | @Override 27 | public LinkedHashMap newContainer(AbstractMemberMetaData mmm) 28 | { 29 | return new LinkedHashMap(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/ConnectionEncryptionProvider.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2010 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store; 19 | 20 | /** 21 | * Interface to be implemented by an decryption provider allowing encrypted passwords 22 | * in persistence properties. 23 | */ 24 | public interface ConnectionEncryptionProvider 25 | { 26 | /** 27 | * Method to decrypt the supplied string. 28 | * @param input The input string 29 | * @return The decrypted form 30 | */ 31 | public String decrypt(String input); 32 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/connection/ConnectionResourceType.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.connection; 19 | 20 | /** 21 | * Resource type of the connection. 22 | */ 23 | public enum ConnectionResourceType 24 | { 25 | JTA("JTA"), 26 | RESOURCE_LOCAL("RESOURCE_LOCAL"); 27 | 28 | String name; 29 | private ConnectionResourceType(String name) 30 | { 31 | this.name = name; 32 | } 33 | 34 | public String toString() 35 | { 36 | return name; 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/ExpFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function EXP(numExpr). 22 | */ 23 | public class ExpFunction extends MathFunction 24 | { 25 | @Override 26 | protected String getFunctionName() 27 | { 28 | return "exp"; 29 | } 30 | 31 | @Override 32 | protected double evaluateMathFunction(double num) 33 | { 34 | return Math.exp(num); 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/LogFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function LOG(numExpr). 22 | */ 23 | public class LogFunction extends MathFunction 24 | { 25 | @Override 26 | protected String getFunctionName() 27 | { 28 | return "log"; 29 | } 30 | 31 | @Override 32 | protected double evaluateMathFunction(double num) 33 | { 34 | return Math.log(num); 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/scostore/Store.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2004 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | 16 | Contributors: 17 | ... 18 | **********************************************************************/ 19 | package org.datanucleus.store.types.scostore; 20 | 21 | import org.datanucleus.metadata.AbstractMemberMetaData; 22 | import org.datanucleus.store.StoreManager; 23 | 24 | /** 25 | * Interface representation of the backing store for a Collection or Map. 26 | */ 27 | public interface Store 28 | { 29 | AbstractMemberMetaData getOwnerMemberMetaData(); 30 | 31 | StoreManager getStoreManager(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/transaction/jta/JTASyncRegistryUnavailableException.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2013 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.transaction.jta; 19 | 20 | /** 21 | * Exception thrown by construction of JTATransactionSyncRegistry when it is not available. 22 | * This could be because JTA1.0 is being used, or there is no JNDI resource available for it. 23 | */ 24 | public class JTASyncRegistryUnavailableException extends Exception 25 | { 26 | 27 | private static final long serialVersionUID = 4724764122936512281L; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/CeilFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function CEIL(numExpr). 22 | */ 23 | public class CeilFunction extends MathFunction 24 | { 25 | @Override 26 | protected String getFunctionName() 27 | { 28 | return "ceil"; 29 | } 30 | 31 | @Override 32 | protected double evaluateMathFunction(double num) 33 | { 34 | return Math.ceil(num); 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/CoshFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2022 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function COSH(numExpr). 22 | */ 23 | public class CoshFunction extends MathFunction 24 | { 25 | @Override 26 | protected String getFunctionName() 27 | { 28 | return "cosh"; 29 | } 30 | 31 | @Override 32 | protected double evaluateMathFunction(double num) 33 | { 34 | return Math.cosh(num); 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/SinhFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2022 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function SINH(numExpr). 22 | */ 23 | public class SinhFunction extends MathFunction 24 | { 25 | @Override 26 | protected String getFunctionName() 27 | { 28 | return "sinh"; 29 | } 30 | 31 | @Override 32 | protected double evaluateMathFunction(double num) 33 | { 34 | return Math.sinh(num); 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/TanhFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2022 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function TANH(numExpr). 22 | */ 23 | public class TanhFunction extends MathFunction 24 | { 25 | @Override 26 | protected String getFunctionName() 27 | { 28 | return "tanh"; 29 | } 30 | 31 | @Override 32 | protected double evaluateMathFunction(double num) 33 | { 34 | return Math.tanh(num); 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/CotangentFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2022 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function COT(numExpr). 22 | */ 23 | public class CotangentFunction extends MathFunction 24 | { 25 | @Override 26 | protected String getFunctionName() 27 | { 28 | return "cot"; 29 | } 30 | 31 | @Override 32 | protected double evaluateMathFunction(double num) 33 | { 34 | return 1.0/Math.tan(num); 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/metadata/MetaDataListener.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.metadata; 19 | 20 | /** 21 | * Listener for registering interest when metadata for a class is loaded. 22 | */ 23 | public interface MetaDataListener 24 | { 25 | /** 26 | * Method called when the metadata for the class is loaded (initialised). 27 | * @param cmd Metadata for the class 28 | * @throws InvalidMetaDataException if the metadata is not considered valid 29 | */ 30 | void loaded(AbstractClassMetaData cmd); 31 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/connection/ManagedConnectionWithListenerAccess.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2024 kraendavid and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.connection; 19 | 20 | import java.util.Collection; 21 | 22 | /** 23 | * Extension of ManagedConnection providing listener access. 24 | */ 25 | public interface ManagedConnectionWithListenerAccess extends ManagedConnection 26 | { 27 | /** 28 | * Get registered listeners. 29 | * @return registered listeners 30 | */ 31 | Collection getListeners(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/JDKListAdapter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato Garcia and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.List; 21 | 22 | public class JDKListAdapter extends JDKCollectionAdapter implements SequenceAdapter 23 | { 24 | public JDKListAdapter(C container) 25 | { 26 | super(container); 27 | } 28 | 29 | @Override 30 | public void update(Object newElement, int position) 31 | { 32 | container.set(position, newElement); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/flush/Operation.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2013 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.flush; 19 | 20 | import org.datanucleus.state.DNStateManager; 21 | 22 | /** 23 | * Interface for an operation to be flushed. 24 | */ 25 | public interface Operation 26 | { 27 | /** 28 | * Accessor for StateManager of the object that this operation is performed on. 29 | * @return StateManager 30 | */ 31 | DNStateManager getStateManager(); 32 | 33 | /** 34 | * Method to perform the operation. 35 | */ 36 | void perform(); 37 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/MultiColumnConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2014 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | /** 21 | * Interface implemented by a TypeConverter when it converts a member to multiple columns, providing the 22 | * information about what types the columns store. 23 | */ 24 | public interface MultiColumnConverter 25 | { 26 | /** 27 | * Accessor for the java types of the datastore columns. 28 | * @return The java types of the columns 29 | */ 30 | Class[] getDatastoreColumnTypes(); 31 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/cache/StrongQueryCompilationCache.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.cache; 19 | 20 | import java.util.concurrent.ConcurrentHashMap; 21 | 22 | import org.datanucleus.NucleusContext; 23 | 24 | /** 25 | * Strong-reference implementation of a generic query compilation cache. 26 | */ 27 | public class StrongQueryCompilationCache extends AbstractQueryCompilationCache 28 | { 29 | public StrongQueryCompilationCache(NucleusContext nucleusCtx) 30 | { 31 | cache = new ConcurrentHashMap(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/cache/StrongQueryDatastoreCompilationCache.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.cache; 19 | 20 | import java.util.HashMap; 21 | 22 | import org.datanucleus.NucleusContext; 23 | 24 | /** 25 | * Strong-referenced implementation of datastore query compilation cache. 26 | */ 27 | public class StrongQueryDatastoreCompilationCache extends AbstractQueryDatastoreCompilationCache 28 | { 29 | public StrongQueryDatastoreCompilationCache(NucleusContext nucleusCtx) 30 | { 31 | cache = new HashMap(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/JPQLResultClassMapper.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2011 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory; 19 | 20 | /** 21 | * Class to map the results of a JPQL query to the result class. 22 | */ 23 | public class JPQLResultClassMapper extends AbstractResultClassMapper 24 | { 25 | /** 26 | * Constructor for the ResultClassMapper which handles setResultClass 27 | * @param resultClass The required result class 28 | */ 29 | public JPQLResultClassMapper(Class resultClass) 30 | { 31 | super(resultClass); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/JDOQLResultClassMapper.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2011 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory; 19 | 20 | /** 21 | * Class to map the results of a JDOQL query to the result class. 22 | */ 23 | public class JDOQLResultClassMapper extends AbstractResultClassMapper 24 | { 25 | /** 26 | * Constructor for the ResultClassMapper which handles setResultClass 27 | * @param resultClass The required result class 28 | */ 29 | public JDOQLResultClassMapper(Class resultClass) 30 | { 31 | super(resultClass); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/resources/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to section 4(d) of the Apache License, == 3 | == Version 2.0, in this case for the DataNucleus distribution. == 4 | ========================================================================= 5 | 6 | =================================================================== 7 | This product includes software developed by many individuals, 8 | including the following: 9 | =================================================================== 10 | Erik Bengtson 11 | Andy Jefferson 12 | 13 | 14 | =================================================================== 15 | This product has included contributions from some individuals, 16 | including the following: 17 | =================================================================== 18 | Joerg von Frantzius 19 | Thomas Marti 20 | Barry Haddow 21 | Marco Schulze 22 | Ralph Ullrich 23 | David Ezzio 24 | Brendan de Beer 25 | David Eaves 26 | Martin Taal 27 | Tony Lai 28 | Roland Szabo 29 | Marcus Mennemeier 30 | Xuan Baldauf 31 | Eric Sultan 32 | 33 | 34 | =================================================================== 35 | This product also includes software developed by the TJDO project 36 | (http://tjdo.sourceforge.net/). 37 | =================================================================== 38 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/connection/package.html: -------------------------------------------------------------------------------- 1 | 2 | Package defining the connection to the datastore. 3 | 4 |

ConnectionManager

5 | This is the entry point into the connection management process. You use it to get a connection to the datastore (ManagedConnection). 6 | This manages a "primary" ConnectionFactory and an optional "secondary" ConnectionFactory. Some datastores only support a single factory. 7 | The ConnectionManager manages 2 caches of the currently allocated ManagedConnection objects, keyed by the ExecutionContext they are for; 8 | an ExecutionContext can only have 1 ManagedConnection per ConnectionFactory. 9 | 10 |

ConnectionFactory

11 | This is responsible for generating the actual connections to the datastore. 12 | Each datastore plugin has to implement this for their own datastore. 13 | There is a provided AbstractConnectionFactory that must be extended to provide this implementation. 14 | 15 |

ManagedConnection

16 | This represents the actual connection to the datastore, wrapping the real connection. 17 | Each datastore plugin has to implement this for their own datastore. 18 | There is a provided AbstractManagedConnection that must be extended to provide this implementation. 19 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/fieldmanager/UnsetOwnerFieldManager.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.fieldmanager; 19 | 20 | import org.datanucleus.store.types.SCO; 21 | 22 | /** 23 | * FieldManager to unset the owner fields of any SCO wrapped fields. 24 | */ 25 | public class UnsetOwnerFieldManager extends AbstractFieldManager 26 | { 27 | public void storeObjectField(int fieldNumber, Object value) 28 | { 29 | if (value instanceof SCO) 30 | { 31 | ((SCO)value).unsetOwner(); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/java/org/datanucleus/store/query/MyResultClass.java: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | Copyright (c) 2010 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | *****************************************************************/ 18 | package org.datanucleus.store.query; 19 | 20 | /** 21 | * Sample result class, for use in testing QueryUtils. 22 | */ 23 | public class MyResultClass 24 | { 25 | private Long id; 26 | private String userId; 27 | 28 | public MyResultClass(Long id,String userId) 29 | { 30 | this.id = id; 31 | this.userId = userId; 32 | } 33 | 34 | public Long getId() 35 | { 36 | return id; 37 | } 38 | 39 | public String getUserId() 40 | { 41 | return userId; 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/cache/StrongQueryResultsCache.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.cache; 19 | 20 | import java.util.HashMap; 21 | 22 | import org.datanucleus.NucleusContext; 23 | 24 | /** 25 | * Strong-reference implementation of a query results cache. 26 | */ 27 | public class StrongQueryResultsCache extends AbstractMapQueryResultsCache 28 | { 29 | private static final long serialVersionUID = -8309204044669474063L; 30 | 31 | public StrongQueryResultsCache(NucleusContext ctx) 32 | { 33 | super(ctx); 34 | cache = new HashMap(); 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/management/ManagerStatisticsMBean.java: -------------------------------------------------------------------------------- 1 | package org.datanucleus.management; 2 | 3 | /** 4 | * Interface defining the MBean for a persistence manager. 5 | */ 6 | public interface ManagerStatisticsMBean 7 | { 8 | String getRegisteredName(); 9 | 10 | int getQueryActiveTotalCount(); 11 | 12 | int getQueryErrorTotalCount(); 13 | 14 | int getQueryExecutionTotalCount(); 15 | 16 | long getQueryExecutionTimeLow(); 17 | 18 | long getQueryExecutionTimeHigh(); 19 | 20 | long getQueryExecutionTotalTime(); 21 | 22 | long getQueryExecutionTimeAverage(); 23 | 24 | int getNumberOfDatastoreWrites(); 25 | 26 | int getNumberOfDatastoreReads(); 27 | 28 | int getNumberOfDatastoreWritesInLatestTxn(); 29 | 30 | int getNumberOfDatastoreReadsInLatestTxn(); 31 | 32 | int getNumberOfObjectFetches(); 33 | 34 | int getNumberOfObjectInserts(); 35 | 36 | int getNumberOfObjectUpdates(); 37 | 38 | int getNumberOfObjectDeletes(); 39 | 40 | long getTransactionExecutionTimeAverage(); 41 | 42 | long getTransactionExecutionTimeLow(); 43 | 44 | long getTransactionExecutionTimeHigh(); 45 | 46 | long getTransactionExecutionTotalTime(); 47 | 48 | int getTransactionTotalCount(); 49 | 50 | int getTransactionActiveTotalCount(); 51 | 52 | int getTransactionCommittedTotalCount(); 53 | 54 | int getTransactionRolledBackTotalCount(); 55 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/metadata/ColumnMetaDataContainer.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2005 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.metadata; 19 | 20 | /** 21 | * Interface defining an object that contains Columns. 22 | */ 23 | public interface ColumnMetaDataContainer 24 | { 25 | /** 26 | * Accessor for columnMetaData 27 | * @return Returns the columnMetaData. 28 | */ 29 | public ColumnMetaData[] getColumnMetaData(); 30 | 31 | /** 32 | * Add a new ColumnMetaData element 33 | * @param colmd The Column MetaData 34 | */ 35 | public void addColumn(ColumnMetaData colmd); 36 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/NoQueryResultsException.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query; 19 | 20 | import org.datanucleus.exceptions.NucleusException; 21 | 22 | /** 23 | * Exception thrown from internal query mechanism if no results are returned. 24 | */ 25 | public class NoQueryResultsException extends NucleusException 26 | { 27 | private static final long serialVersionUID = -5046488758382548159L; 28 | 29 | /** 30 | * Constructor. 31 | * @param msg Message text 32 | */ 33 | public NoQueryResultsException(String msg) 34 | { 35 | super(msg); 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/transaction/jta/TransactionManagerLocator.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2007 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.transaction.jta; 19 | 20 | import javax.transaction.TransactionManager; 21 | 22 | import org.datanucleus.ClassLoaderResolver; 23 | 24 | /** 25 | * Locator for a JTA TransactionManager. 26 | */ 27 | public interface TransactionManagerLocator 28 | { 29 | /** 30 | * Method to return the TransactionManager. 31 | * @param clr ClassLoader resolver 32 | * @return The TransactionManager 33 | */ 34 | TransactionManager getTransactionManager(ClassLoaderResolver clr); 35 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/management/ManagerStatistics.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.management; 19 | 20 | /** 21 | * Statistics for a manager of persistence (PersistenceManager/EntityManager). 22 | * Provides access to statistics about datastores accesses, queries and transactions. 23 | * Any statistics are represented also in the factory owning this manager. 24 | */ 25 | public class ManagerStatistics extends AbstractStatistics implements ManagerStatisticsMBean 26 | { 27 | public ManagerStatistics(ManagementManager mgmtManager, FactoryStatistics parent) 28 | { 29 | super(mgmtManager, parent); 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/metadata/MetaDataFileType.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.metadata; 19 | 20 | /** 21 | * Enum for the different types of metadata "files". 22 | */ 23 | public enum MetaDataFileType 24 | { 25 | JDO_FILE("jdo"), 26 | JDO_ORM_FILE("orm"), 27 | JDO_QUERY_FILE("jdoquery"), 28 | ANNOTATIONS("annotations"), 29 | JPA_MAPPING_FILE("jpa_mapping"); // Also Jakarta mapping 30 | 31 | String name; 32 | 33 | private MetaDataFileType(String name) 34 | { 35 | this.name = name; 36 | } 37 | 38 | public String toString() 39 | { 40 | return name; 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/metadata/MetaDataScanner.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.metadata; 19 | 20 | import java.util.Set; 21 | 22 | /** 23 | * Scanner for persistable classes, typically provided by a JEE environment to locate classes 24 | * not easily/efficiently locatable using the builtin file scanner. 25 | */ 26 | public interface MetaDataScanner 27 | { 28 | /** 29 | * Scan for persistable classes. 30 | * @param pumd The persistence unit meta data 31 | * @return Names of persistable classes that were found 32 | */ 33 | Set scanForPersistableClasses(PersistenceUnitMetaData pumd); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/state/LockMode.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2017 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.state; 19 | 20 | /** 21 | * Locking modes for persistable objects. 22 | */ 23 | public enum LockMode 24 | { 25 | /** No locking specified. Use default type. */ 26 | LOCK_NONE, 27 | 28 | /** Optimistic locking. */ 29 | LOCK_OPTIMISTIC_READ, 30 | 31 | /** Optimistic locking, plus forced version update at commit. */ 32 | LOCK_OPTIMISTIC_WRITE, 33 | 34 | /** Pessimistic locking. */ 35 | LOCK_PESSIMISTIC_READ, 36 | 37 | /** Pessimistic locking, plus forced version update at commit. */ 38 | LOCK_PESSIMISTIC_WRITE; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/TreeSetHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.Arrays; 21 | import java.util.TreeSet; 22 | 23 | import org.datanucleus.metadata.AbstractMemberMetaData; 24 | 25 | public class TreeSetHandler extends JDKCollectionHandler 26 | { 27 | @Override 28 | public TreeSet newContainer(AbstractMemberMetaData mmm) 29 | { 30 | return new TreeSet(); 31 | } 32 | 33 | @Override 34 | public TreeSet newContainer(AbstractMemberMetaData mmd, Object... objects) 35 | { 36 | return new TreeSet(Arrays.asList(objects)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/SignFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2022 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function SIGN(numExpr). 22 | */ 23 | public class SignFunction extends MathFunction 24 | { 25 | @Override 26 | protected String getFunctionName() 27 | { 28 | return "sign"; 29 | } 30 | 31 | @Override 32 | protected double evaluateMathFunction(double num) 33 | { 34 | if (num > 0) 35 | { 36 | return 1; 37 | } 38 | if (num < 0) 39 | { 40 | return -1; 41 | } 42 | return 0; 43 | } 44 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/cache/SoftQueryCompilationCache.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.cache; 19 | 20 | import org.datanucleus.NucleusContext; 21 | import org.datanucleus.util.ConcurrentReferenceHashMap; 22 | import org.datanucleus.util.ConcurrentReferenceHashMap.ReferenceType; 23 | 24 | /** 25 | * Soft-reference implementation of a generic query compilation cache. 26 | */ 27 | public class SoftQueryCompilationCache extends AbstractQueryCompilationCache 28 | { 29 | public SoftQueryCompilationCache(NucleusContext nucleusCtx) 30 | { 31 | cache = new ConcurrentReferenceHashMap<>(1, ReferenceType.STRONG, ReferenceType.SOFT); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/compiler/Symbol.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Erik Bengtson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | 2009 Andy Jefferson - removed the value of the symbol so it can be thread-safe 17 | ... 18 | **********************************************************************/ 19 | package org.datanucleus.store.query.compiler; 20 | 21 | /** 22 | * A symbol in a query. Registers the name and the type of the symbol. 23 | */ 24 | public interface Symbol 25 | { 26 | public static final int IDENTIFIER = 0; 27 | public static final int PARAMETER = 1; 28 | public static final int VARIABLE = 2; 29 | 30 | void setType(int type); 31 | int getType(); 32 | 33 | String getQualifiedName(); 34 | 35 | void setValueType(Class type); 36 | Class getValueType(); 37 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/HashSetHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato Garcia and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.Arrays; 21 | import java.util.HashSet; 22 | import java.util.Set; 23 | 24 | import org.datanucleus.metadata.AbstractMemberMetaData; 25 | 26 | public class HashSetHandler extends JDKCollectionHandler 27 | { 28 | @Override 29 | public Set newContainer(AbstractMemberMetaData mmm) 30 | { 31 | return new HashSet<>(); 32 | } 33 | 34 | @Override 35 | public Set newContainer(AbstractMemberMetaData mmd, Object... objects) 36 | { 37 | return new HashSet<>(Arrays.asList(objects)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/LocalDateFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2022 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | import org.datanucleus.store.query.expression.InvokeExpression; 21 | import org.datanucleus.store.query.inmemory.InMemoryExpressionEvaluator; 22 | import org.datanucleus.store.query.inmemory.InvocationEvaluator; 23 | 24 | /** 25 | * Evaluator for the function LOCAL_DATE(). 26 | */ 27 | public class LocalDateFunction implements InvocationEvaluator 28 | { 29 | @Override 30 | public Object evaluate(InvokeExpression expr, Object invokedValue, InMemoryExpressionEvaluator eval) 31 | { 32 | return java.time.LocalDate.now(); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/LocalTimeFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2022 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | import org.datanucleus.store.query.expression.InvokeExpression; 21 | import org.datanucleus.store.query.inmemory.InMemoryExpressionEvaluator; 22 | import org.datanucleus.store.query.inmemory.InvocationEvaluator; 23 | 24 | /** 25 | * Evaluator for the function LOCAL_TIME(). 26 | */ 27 | public class LocalTimeFunction implements InvocationEvaluator 28 | { 29 | @Override 30 | public Object evaluate(InvokeExpression expr, Object invokedValue, InMemoryExpressionEvaluator eval) 31 | { 32 | return java.time.LocalTime.now(); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/flush/SCOOperation.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2013 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.flush; 19 | 20 | import org.datanucleus.metadata.AbstractMemberMetaData; 21 | import org.datanucleus.store.types.scostore.Store; 22 | 23 | /** 24 | * (Queued) operation performed on a backing store. 25 | */ 26 | public interface SCOOperation extends Operation 27 | { 28 | /** 29 | * Accessor for the metadata for the member that this operation is for. 30 | * @return The member metadata 31 | */ 32 | AbstractMemberMetaData getMemberMetaData(); 33 | 34 | /** 35 | * Accessor for the backing store for this operation. 36 | * @return The backing store 37 | */ 38 | Store getStore(); 39 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/LinkedHashSetHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.Arrays; 21 | import java.util.LinkedHashSet; 22 | 23 | import org.datanucleus.metadata.AbstractMemberMetaData; 24 | 25 | public class LinkedHashSetHandler extends JDKCollectionHandler 26 | { 27 | @Override 28 | public LinkedHashSet newContainer(AbstractMemberMetaData mmm) 29 | { 30 | return new LinkedHashSet(); 31 | } 32 | 33 | @Override 34 | public LinkedHashSet newContainer(AbstractMemberMetaData mmd, Object... objects) 35 | { 36 | return new LinkedHashSet(Arrays.asList(objects)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/LocalDateTimeFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2022 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | import org.datanucleus.store.query.expression.InvokeExpression; 21 | import org.datanucleus.store.query.inmemory.InMemoryExpressionEvaluator; 22 | import org.datanucleus.store.query.inmemory.InvocationEvaluator; 23 | 24 | /** 25 | * Evaluator for the function LOCAL_DATETIME(). 26 | */ 27 | public class LocalDateTimeFunction implements InvocationEvaluator 28 | { 29 | @Override 30 | public Object evaluate(InvokeExpression expr, Object invokedValue, InMemoryExpressionEvaluator eval) 31 | { 32 | return java.time.LocalDateTime.now(); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/PriorityQueueHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.Arrays; 21 | import java.util.PriorityQueue; 22 | import java.util.Queue; 23 | 24 | import org.datanucleus.metadata.AbstractMemberMetaData; 25 | 26 | public class PriorityQueueHandler extends JDKCollectionHandler 27 | { 28 | @Override 29 | public Queue newContainer(AbstractMemberMetaData mmm) 30 | { 31 | return new PriorityQueue(); 32 | } 33 | 34 | @Override 35 | public Queue newContainer(AbstractMemberMetaData mmd, Object... objects) 36 | { 37 | return new PriorityQueue(Arrays.asList(objects)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/cache/SoftQueryDatastoreCompilationCache.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.cache; 19 | 20 | import org.datanucleus.NucleusContext; 21 | import org.datanucleus.util.ConcurrentReferenceHashMap; 22 | import org.datanucleus.util.ConcurrentReferenceHashMap.ReferenceType; 23 | 24 | /** 25 | * Weak-referenced implementation of datastore query compilation cache. 26 | */ 27 | public class SoftQueryDatastoreCompilationCache extends AbstractQueryDatastoreCompilationCache 28 | { 29 | public SoftQueryDatastoreCompilationCache(NucleusContext nucleusCtx) 30 | { 31 | cache = new ConcurrentReferenceHashMap<>(1, ReferenceType.STRONG, ReferenceType.SOFT); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/cache/WeakQueryDatastoreCompilationCache.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.cache; 19 | 20 | import org.datanucleus.NucleusContext; 21 | import org.datanucleus.util.ConcurrentReferenceHashMap; 22 | import org.datanucleus.util.ConcurrentReferenceHashMap.ReferenceType; 23 | 24 | /** 25 | * Weak-referenced implementation of datastore query compilation cache. 26 | */ 27 | public class WeakQueryDatastoreCompilationCache extends AbstractQueryDatastoreCompilationCache 28 | { 29 | public WeakQueryDatastoreCompilationCache(NucleusContext nucleusCtx) 30 | { 31 | cache = new ConcurrentReferenceHashMap<>(1, ReferenceType.STRONG, ReferenceType.WEAK); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/QueryInterruptedException.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query; 19 | 20 | import org.datanucleus.exceptions.NucleusException; 21 | 22 | /** 23 | * Exception thrown when a query execution is interrupted. 24 | */ 25 | public class QueryInterruptedException extends NucleusException 26 | { 27 | private static final long serialVersionUID = 4875874100202871443L; 28 | 29 | public QueryInterruptedException() 30 | { 31 | super(); 32 | } 33 | 34 | public QueryInterruptedException(String msg) 35 | { 36 | super(msg); 37 | } 38 | 39 | public QueryInterruptedException(String msg, Throwable e) 40 | { 41 | super(msg, e); 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/QueryInvalidParametersException.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2007 Erik Bengtson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query; 19 | 20 | import org.datanucleus.exceptions.NucleusUserException; 21 | 22 | /** 23 | * Exception thrown when invalid arguments/parameters are given. 24 | */ 25 | public class QueryInvalidParametersException extends NucleusUserException 26 | { 27 | private static final long serialVersionUID = -8859715327729874369L; 28 | 29 | /** 30 | * Constructs a new exception with the specified detail message. 31 | * @param msg the detail message. 32 | */ 33 | public QueryInvalidParametersException(String msg) 34 | { 35 | super(msg); 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/ColumnLengthDefiningTypeConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2014 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | /** 21 | * Interface implemented by a TypeConverter if it has default length values for any of its datastore columns. 22 | * Typically used by a column stored as a String. 23 | */ 24 | public interface ColumnLengthDefiningTypeConverter 25 | { 26 | /** 27 | * Accessor for the default column length to use for the datastore column at the specified position. 28 | * @param columnPosition Position of the column being enquired about (0 = first) 29 | * @return The column length (-1 if no preference) 30 | */ 31 | int getDefaultColumnLength(int columnPosition); 32 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/identity/IdentityStringTranslator.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.identity; 19 | 20 | import java.io.Serializable; 21 | 22 | import org.datanucleus.ExecutionContext; 23 | 24 | /** 25 | * Translator for object identities where the user wants to input identities that are not strict 26 | * JDO standard toString() forms, so this converts them. 27 | */ 28 | public interface IdentityStringTranslator extends Serializable 29 | { 30 | /** 31 | * Method to translate the object into the identity. 32 | * @param ec ExecutionContext 33 | * @param stringId String form of the identity 34 | * @return The identity 35 | */ 36 | Object getIdentity(ExecutionContext ec, String stringId); 37 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/metadata/package.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | Provides classes representing the MetaData for files, packages, classes, fields, containers, etc. 4 | Structured to map to the JDO2 Meta-Data file structure, though also now maps to the JPA Meta-Data structure 5 | approximately. 6 |

7 |

8 | Key aspects of this package are 9 |

10 |
    11 |
  • MetaDataManager is the entry point into this package. A call is typically made to getMetaDataForClass 12 | and the MetaDataManager will take care of finding the MetaData, parsing any files, and populating the MetaData.
  • 13 |
  • MetaDataMerger is responsible for merging annotations with metadata, and JDO MetaData with ORM MetaData
  • 14 |
  • FileMetaData is the top level of a metadata representation, represening the actual file. It will contain 15 | metadata for a series of packages, etc. The components are laid out in a tree
  • 16 |
  • ClassMetaData is the most used class, and is the representation of the persistence of a class. 17 | It contains a series of FieldMetaData/PropertyMetaDataobjects, representing the fields and properties 18 | of the class.
  • 19 |
20 |

21 | The "data" classes have a lifecycle, being created, then populated, and finally initialised. When a file is read in 22 | all classes are read and populated at that time. 23 |

24 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/QueryTimeoutException.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query; 19 | 20 | import org.datanucleus.exceptions.NucleusException; 21 | 22 | /** 23 | * Exception thrown when a query times out beyond some specified timeout duration. 24 | */ 25 | public class QueryTimeoutException extends NucleusException 26 | { 27 | private static final long serialVersionUID = -4856425363125315854L; 28 | 29 | public QueryTimeoutException() 30 | { 31 | super(); 32 | } 33 | 34 | public QueryTimeoutException(String msg) 35 | { 36 | super(msg); 37 | } 38 | 39 | public QueryTimeoutException(String msg, Throwable e) 40 | { 41 | super(msg, e); 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/ElementContainerAdapter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | public abstract class ElementContainerAdapter implements ContainerAdapter 21 | { 22 | protected C container; 23 | 24 | public ElementContainerAdapter(C container) 25 | { 26 | this.container = container; 27 | } 28 | 29 | @Override 30 | public C getContainer() 31 | { 32 | return container; 33 | } 34 | 35 | protected void setContainer(C container) 36 | { 37 | this.container = container; 38 | } 39 | 40 | public abstract void add(Object newElement); 41 | 42 | public abstract void remove(Object element); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/CharacterStringConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2014 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | /** 21 | * Class to handle the conversion between Character and a String form. 22 | */ 23 | public class CharacterStringConverter implements TypeConverter 24 | { 25 | private static final long serialVersionUID = 5510626063899761384L; 26 | 27 | public Character toMemberType(String str) 28 | { 29 | if (str == null) 30 | { 31 | return null; 32 | } 33 | 34 | return str.charAt(0); 35 | } 36 | 37 | public String toDatastoreType(Character chr) 38 | { 39 | return chr != null ? "" + chr : null; 40 | } 41 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/EncryptionAwareStoreManager.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2011 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store; 19 | 20 | /** 21 | * Interface implemented by any StoreManager that wants to provide a hook to encrypt field data 22 | * prior to persistence. 23 | */ 24 | public interface EncryptionAwareStoreManager 25 | { 26 | /** 27 | * Method to set the encryption provider for persistent data. 28 | * When a provider is set on the StoreManager, any persist (insert/update) or retrieval will be intercepted. 29 | * This should be called before the StoreManager is used for persistence/retrieval. 30 | * @param provider The provider to use. 31 | */ 32 | void setEncryptionProvider(PersistenceEncryptionProvider provider); 33 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/NucleusConnection.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2007 Erik Bengtson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | 16 | Contributors: 17 | ... 18 | **********************************************************************/ 19 | package org.datanucleus.store; 20 | 21 | /** 22 | * Access to the underlying DataStore Connection. 23 | */ 24 | public interface NucleusConnection 25 | { 26 | /** 27 | * Accessor for the underlying connection. 28 | * @return The native connection 29 | */ 30 | public Object getNativeConnection(); 31 | 32 | /** 33 | * Method to close the connection, handing it back to DataNucleus. 34 | */ 35 | public void close(); 36 | 37 | /** 38 | * Accessor for whether the connection is available. 39 | * @return Whether it is available 40 | */ 41 | public boolean isAvailable(); 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/metadata/annotations/ClassAnnotationHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2011 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.metadata.annotations; 19 | 20 | import org.datanucleus.ClassLoaderResolver; 21 | import org.datanucleus.metadata.AbstractClassMetaData; 22 | 23 | /** 24 | * Interface defining a handler for class annotations. 25 | */ 26 | public interface ClassAnnotationHandler 27 | { 28 | /** 29 | * Method to process a class level annotation. 30 | * @param annotation The annotation 31 | * @param cmd Metadata for the class to update with any necessary information. 32 | * @param clr ClassLoader resolver 33 | */ 34 | void processClassAnnotation(AnnotationObject annotation, AbstractClassMetaData cmd, ClassLoaderResolver clr); 35 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/SCOList.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2004 Erik Bengtson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types; 19 | 20 | /** 21 | * Representation of a wrapper for a mutable List SCO type supported. 22 | **/ 23 | public interface SCOList extends SCOCollection 24 | { 25 | /** 26 | * Overload the basic List set() method to allow turning off of the dependent-field 27 | * deletion process. 28 | * @param index The index to set the element at 29 | * @param element The element 30 | * @param allowDependentField Whether to allow dependent-field deletes 31 | * @return The previous object at this position 32 | */ 33 | public E set(int index, E element, boolean allowDependentField); 34 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/containers/StackHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2015 Renato and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.containers; 19 | 20 | import java.util.Stack; 21 | 22 | import org.datanucleus.metadata.AbstractMemberMetaData; 23 | 24 | public class StackHandler extends JDKCollectionHandler 25 | { 26 | @Override 27 | public Stack newContainer(AbstractMemberMetaData mmm) 28 | { 29 | return new Stack(); 30 | } 31 | 32 | @Override 33 | public Stack newContainer(AbstractMemberMetaData mmd, Object... objects) 34 | { 35 | Stack stack = new Stack(); 36 | 37 | for (Object object : objects) 38 | { 39 | stack.push(object); 40 | } 41 | 42 | return stack; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/cache/SoftQueryResultsCache.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.cache; 19 | 20 | import org.datanucleus.NucleusContext; 21 | import org.datanucleus.util.ConcurrentReferenceHashMap; 22 | import org.datanucleus.util.ConcurrentReferenceHashMap.ReferenceType; 23 | 24 | /** 25 | * Soft-reference implementation of a query results cache. 26 | */ 27 | public class SoftQueryResultsCache extends AbstractMapQueryResultsCache 28 | { 29 | private static final long serialVersionUID = -2353653447203789565L; 30 | 31 | public SoftQueryResultsCache(NucleusContext ctx) 32 | { 33 | super(ctx); 34 | cache = new ConcurrentReferenceHashMap<>(1, ReferenceType.STRONG, ReferenceType.SOFT); 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/cache/WeakQueryResultsCache.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.cache; 19 | 20 | import org.datanucleus.NucleusContext; 21 | import org.datanucleus.util.ConcurrentReferenceHashMap; 22 | import org.datanucleus.util.ConcurrentReferenceHashMap.ReferenceType; 23 | 24 | /** 25 | * Weak-reference implementation of a query results cache. 26 | */ 27 | public class WeakQueryResultsCache extends AbstractMapQueryResultsCache 28 | { 29 | private static final long serialVersionUID = 5007468676679033002L; 30 | 31 | public WeakQueryResultsCache(NucleusContext ctx) 32 | { 33 | super(ctx); 34 | cache = new ConcurrentReferenceHashMap<>(1, ReferenceType.STRONG, ReferenceType.WEAK); 35 | } 36 | } -------------------------------------------------------------------------------- /src/test/java/org/datanucleus/util/ConcurrentRefMapSoftValueTest.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2017 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.util; 19 | 20 | import java.util.Map; 21 | 22 | import org.datanucleus.util.ConcurrentReferenceHashMap.ReferenceType; 23 | 24 | /** 25 | * Tests the functionality of ConcurrentReferenceHashMap with SOFT values. 26 | */ 27 | public class ConcurrentRefMapSoftValueTest extends ReferenceValueMapTestCase 28 | { 29 | public ConcurrentRefMapSoftValueTest(String name) 30 | { 31 | super(name); 32 | } 33 | 34 | protected Map newReferenceValueMap() 35 | { 36 | return new ConcurrentReferenceHashMap(1, ReferenceType.STRONG, ReferenceType.SOFT); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/datanucleus/util/ConcurrentRefMapWeakValueTest.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2016 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.util; 19 | 20 | import java.util.Map; 21 | 22 | import org.datanucleus.util.ConcurrentReferenceHashMap.ReferenceType; 23 | 24 | /** 25 | * Tests the functionality of ConcurrentReferenceHashMap with WEAK values. 26 | */ 27 | public class ConcurrentRefMapWeakValueTest extends ReferenceValueMapTestCase 28 | { 29 | public ConcurrentRefMapWeakValueTest(String name) 30 | { 31 | super(name); 32 | } 33 | 34 | protected Map newReferenceValueMap() 35 | { 36 | return new ConcurrentReferenceHashMap(1, ReferenceType.STRONG, ReferenceType.WEAK); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/cache/TieredLevel1Cache.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2024 kraendavid and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.cache; 19 | 20 | import org.datanucleus.state.DNStateManager; 21 | 22 | /** 23 | * A marker interface for Level1Cache for optimizing commit. 24 | * During commit we are not interested in hollow PC objects in Level1 25 | * cache - Level1 caches implementing this interface could optimize 26 | * the filtering of finding non-hollow PC objects. 27 | */ 28 | public interface TieredLevel1Cache extends Level1Cache 29 | { 30 | /** 31 | * Return non-hollow state managers that could be considered as dirty during commit phase. 32 | * @return non-hollow state managers to consider during commit phase 33 | */ 34 | Iterable hotValues(); 35 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/exceptions/CommitStateTransitionException.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.exceptions; 19 | 20 | import org.datanucleus.util.Localiser; 21 | 22 | /** 23 | * A CommitStateTransitionException is thrown when an error occurs 24 | * transitioning from one lifecycle state to another. 25 | */ 26 | public class CommitStateTransitionException extends NucleusException 27 | { 28 | private static final long serialVersionUID = 5977558567821991933L; 29 | 30 | /** 31 | * Constructor. 32 | * @param nested Nested exceptions 33 | **/ 34 | public CommitStateTransitionException(java.lang.Exception[] nested) 35 | { 36 | super(Localiser.msg("015037"),nested); 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/SqlDateLongConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | import java.sql.Date; 21 | 22 | /** 23 | * Class to handle the conversion between java.sql.Date and a Long form. 24 | */ 25 | public class SqlDateLongConverter implements TypeConverter 26 | { 27 | private static final long serialVersionUID = 7276158028007180L; 28 | 29 | public Date toMemberType(Long value) 30 | { 31 | if (value == null) 32 | { 33 | return null; 34 | } 35 | 36 | return new java.sql.Date(value); 37 | } 38 | 39 | public Long toDatastoreType(Date date) 40 | { 41 | return date != null ? date.getTime() : null; 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/SqlTimeLongConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | import java.sql.Time; 21 | 22 | /** 23 | * Class to handle the conversion between java.sql.Time and a Long form. 24 | */ 25 | public class SqlTimeLongConverter implements TypeConverter 26 | { 27 | private static final long serialVersionUID = -4450441515073250228L; 28 | 29 | public Time toMemberType(Long value) 30 | { 31 | if (value == null) 32 | { 33 | return null; 34 | } 35 | 36 | return new java.sql.Time(value); 37 | } 38 | 39 | public Long toDatastoreType(Time time) 40 | { 41 | return time != null ? time.getTime() : null; 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/YearIntegerConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2014 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | import java.time.Year; 21 | 22 | /** 23 | * Class to handle the conversion between java.time.Year and Integer. 24 | */ 25 | public class YearIntegerConverter implements TypeConverter 26 | { 27 | private static final long serialVersionUID = -975145761836531481L; 28 | 29 | public Year toMemberType(Integer val) 30 | { 31 | if (val == null) 32 | { 33 | return null; 34 | } 35 | 36 | return Year.of(val); 37 | } 38 | 39 | public Integer toDatastoreType(Year year) 40 | { 41 | return year != null ? year.getValue() : null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/cache/WeakQueryCompilationCache.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2009 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.cache; 19 | 20 | import org.datanucleus.NucleusContext; 21 | import org.datanucleus.store.query.compiler.QueryCompilation; 22 | import org.datanucleus.util.ConcurrentReferenceHashMap; 23 | import org.datanucleus.util.ConcurrentReferenceHashMap.ReferenceType; 24 | 25 | /** 26 | * Weak-reference implementation of a generic query compilation cache. 27 | */ 28 | public class WeakQueryCompilationCache extends AbstractQueryCompilationCache 29 | { 30 | public WeakQueryCompilationCache(NucleusContext nucleusCtx) 31 | { 32 | cache = new ConcurrentReferenceHashMap(1, ReferenceType.STRONG, ReferenceType.WEAK); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/BooleanIntegerConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2014 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | /** 21 | * Class to handle the conversion between java.lang.Boolean and an Integer (0, 1) form. 22 | */ 23 | public class BooleanIntegerConverter implements TypeConverter 24 | { 25 | private static final long serialVersionUID = -6180650436706210421L; 26 | 27 | public Boolean toMemberType(Integer val) 28 | { 29 | if (val == null) 30 | { 31 | return null; 32 | } 33 | 34 | return val == 1 ? true : false; 35 | } 36 | 37 | public Integer toDatastoreType(Boolean bool) 38 | { 39 | return bool != null ? (bool ? 1 : 0) : null; 40 | } 41 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/identity/IdentityKeyTranslator.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2011 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.identity; 19 | 20 | import java.io.Serializable; 21 | 22 | import org.datanucleus.ExecutionContext; 23 | 24 | /** 25 | * Translator for object identities where the user wants to input identities that are not strict 26 | * key forms, so this returns a valid identity. 27 | */ 28 | public interface IdentityKeyTranslator extends Serializable 29 | { 30 | /** 31 | * Method to translate the object into the identity. 32 | * @param ec ExecutionContext 33 | * @param cls Class of the persistent object 34 | * @param key The passed in key 35 | * @return The valid key for this class 36 | */ 37 | Object getKey(ExecutionContext ec, Class cls, Object key); 38 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/QueryNotUniqueException.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2005 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | 16 | Contributors: 17 | ... 18 | **********************************************************************/ 19 | package org.datanucleus.store.query; 20 | 21 | import org.datanucleus.exceptions.NucleusUserException; 22 | import org.datanucleus.util.Localiser; 23 | 24 | /** 25 | * This exception is thrown when a user runs a Query and has marked it as UNIQUE, but 26 | * it returns more than 1 object. 27 | */ 28 | public class QueryNotUniqueException extends NucleusUserException 29 | { 30 | private static final long serialVersionUID = -7458437974414546277L; 31 | 32 | /** 33 | * Constructs the exception, populating the correct message. 34 | */ 35 | public QueryNotUniqueException() 36 | { 37 | super(Localiser.msg("021001")); 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/compiler/ParameterNode.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.compiler; 19 | 20 | /** 21 | * Node representing a parameter. 22 | * This is sub-classed so that we can store the parameter position at compile. 23 | */ 24 | public class ParameterNode extends Node 25 | { 26 | int position; 27 | 28 | public ParameterNode(NodeType nodeType, int position) 29 | { 30 | super(nodeType); 31 | this.position = position; 32 | } 33 | 34 | public ParameterNode(NodeType nodeType, Object nodeValue, int position) 35 | { 36 | super(nodeType, nodeValue); 37 | this.position = position; 38 | } 39 | 40 | public int getPosition() 41 | { 42 | return position; 43 | } 44 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/BigIntegerLongConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2014 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | import java.math.BigInteger; 21 | 22 | /** 23 | * Class to handle the conversion between java.math.BigInteger and a Long form. 24 | */ 25 | public class BigIntegerLongConverter implements TypeConverter 26 | { 27 | private static final long serialVersionUID = -946874444222779197L; 28 | 29 | public BigInteger toMemberType(Long val) 30 | { 31 | if (val == null) 32 | { 33 | return null; 34 | } 35 | 36 | return BigInteger.valueOf(val); 37 | } 38 | 39 | public Long toDatastoreType(BigInteger bi) 40 | { 41 | return bi.longValue(); 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/NumericAggregateExpression.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Erik Bengtson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory; 19 | 20 | public class NumericAggregateExpression extends AggregateExpression 21 | { 22 | Number value; 23 | 24 | public NumericAggregateExpression(Number value) 25 | { 26 | this.value = value; 27 | } 28 | 29 | public Object add(Object obj) 30 | { 31 | throw new UnsupportedOperationException(); 32 | } 33 | 34 | public Object sub(Object obj) 35 | { 36 | throw new UnsupportedOperationException(); 37 | } 38 | 39 | public Object div(Object obj) 40 | { 41 | throw new UnsupportedOperationException(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/BooleanYNConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2014 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | /** 21 | * Class to handle the conversion between java.lang.Boolean and a Character ("Y", "N") form. 22 | */ 23 | public class BooleanYNConverter implements TypeConverter 24 | { 25 | private static final long serialVersionUID = 778758633106246559L; 26 | 27 | public Boolean toMemberType(Character chr) 28 | { 29 | if (chr == null) 30 | { 31 | return null; 32 | } 33 | 34 | return chr.equals('Y') ? true : false; 35 | } 36 | 37 | public Character toDatastoreType(Boolean bool) 38 | { 39 | return bool != null ? (bool ? 'Y' : 'N') : null; 40 | } 41 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/SqlDateDateConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2014 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | import java.sql.Date; 21 | 22 | /** 23 | * Class to handle the conversion between java.sql.Date and a java.util.Date form. 24 | */ 25 | public class SqlDateDateConverter implements TypeConverter 26 | { 27 | private static final long serialVersionUID = 3850097783909422945L; 28 | 29 | public Date toMemberType(java.util.Date value) 30 | { 31 | if (value == null) 32 | { 33 | return null; 34 | } 35 | 36 | return new java.sql.Date(value.getTime()); 37 | } 38 | 39 | public java.util.Date toDatastoreType(Date date) 40 | { 41 | return date; 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/SqlTimeDateConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2014 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | import java.sql.Time; 21 | 22 | /** 23 | * Class to handle the conversion between java.sql.Time and a java.util.Date form. 24 | */ 25 | public class SqlTimeDateConverter implements TypeConverter 26 | { 27 | private static final long serialVersionUID = 3817497258319725482L; 28 | 29 | public Time toMemberType(java.util.Date value) 30 | { 31 | if (value == null) 32 | { 33 | return null; 34 | } 35 | 36 | return new java.sql.Time(value.getTime()); 37 | } 38 | 39 | public java.util.Date toDatastoreType(Time time) 40 | { 41 | return time; 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/StringBufferStringConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | /** 21 | * Class to handle the conversion between java.lang.StringBuffer and a String form. 22 | */ 23 | public class StringBufferStringConverter implements TypeConverter 24 | { 25 | private static final long serialVersionUID = -4453706060312496022L; 26 | 27 | public StringBuffer toMemberType(String str) 28 | { 29 | if (str == null) 30 | { 31 | return null; 32 | } 33 | 34 | return new StringBuffer(str); 35 | } 36 | 37 | public String toDatastoreType(StringBuffer str) 38 | { 39 | return str != null ? str.toString() : null; 40 | } 41 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/metadata/annotations/MemberAnnotationHandler.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2011 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.metadata.annotations; 19 | 20 | import org.datanucleus.ClassLoaderResolver; 21 | import org.datanucleus.metadata.AbstractMemberMetaData; 22 | 23 | /** 24 | * Interface defining a handler for field/property annotations. 25 | */ 26 | public interface MemberAnnotationHandler 27 | { 28 | /** 29 | * Method to process a member (field/property) level annotation. 30 | * @param annotation The annotation 31 | * @param mmd Metadata for the member to update with any necessary information. 32 | * @param clr ClassLoader resolver 33 | */ 34 | void processMemberAnnotation(AnnotationObject annotation, AbstractMemberMetaData mmd, ClassLoaderResolver clr); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/properties/StringPropertyValidator.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.properties; 19 | 20 | /** 21 | * Validator for a property that represents a String. 22 | */ 23 | public class StringPropertyValidator implements PropertyValidator 24 | { 25 | /** 26 | * Method to validate the property, allowing only String. 27 | * @param name Name of property 28 | * @param value Value of property 29 | * @return Whether it is valid 30 | */ 31 | public boolean validate(String name, Object value) 32 | { 33 | if (value == null) 34 | { 35 | return true; 36 | } 37 | else if (value instanceof String) 38 | { 39 | return true; 40 | } 41 | return false; 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/AbsFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function ABS(numExpr). 22 | */ 23 | public class AbsFunction extends MathFunction 24 | { 25 | /* (non-Javadoc) 26 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#getFunctionName() 27 | */ 28 | @Override 29 | protected String getFunctionName() 30 | { 31 | return "abs"; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#evaluateMathFunction(double) 36 | */ 37 | @Override 38 | protected double evaluateMathFunction(double num) 39 | { 40 | return Math.abs(num); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/StringBuilderStringConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2013 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | /** 21 | * Class to handle the conversion between java.lang.StringBuilder and a String form. 22 | */ 23 | public class StringBuilderStringConverter implements TypeConverter 24 | { 25 | private static final long serialVersionUID = -6443349700077274745L; 26 | 27 | public StringBuilder toMemberType(String str) 28 | { 29 | if (str == null) 30 | { 31 | return null; 32 | } 33 | 34 | return new StringBuilder(str); 35 | } 36 | 37 | public String toDatastoreType(StringBuilder str) 38 | { 39 | return str != null ? str.toString() : null; 40 | } 41 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/CosineFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function COS(numExpr). 22 | */ 23 | public class CosineFunction extends MathFunction 24 | { 25 | /* (non-Javadoc) 26 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#getFunctionName() 27 | */ 28 | @Override 29 | protected String getFunctionName() 30 | { 31 | return "cos"; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#evaluateMathFunction(double) 36 | */ 37 | @Override 38 | protected double evaluateMathFunction(double num) 39 | { 40 | return Math.cos(num); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/SineFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function SIN(numExpr). 22 | */ 23 | public class SineFunction extends MathFunction 24 | { 25 | /* (non-Javadoc) 26 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#getFunctionName() 27 | */ 28 | @Override 29 | protected String getFunctionName() 30 | { 31 | return "sin"; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#evaluateMathFunction(double) 36 | */ 37 | @Override 38 | protected double evaluateMathFunction(double num) 39 | { 40 | return Math.sin(num); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/SqrtFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function SQRT(numExpr). 22 | */ 23 | public class SqrtFunction extends MathFunction 24 | { 25 | /* (non-Javadoc) 26 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#getFunctionName() 27 | */ 28 | @Override 29 | protected String getFunctionName() 30 | { 31 | return "sqrt"; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#evaluateMathFunction(double) 36 | */ 37 | @Override 38 | protected double evaluateMathFunction(double num) 39 | { 40 | return Math.sqrt(num); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/ArcSineFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function ASIN(numExpr). 22 | */ 23 | public class ArcSineFunction extends MathFunction 24 | { 25 | /* (non-Javadoc) 26 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#getFunctionName() 27 | */ 28 | @Override 29 | protected String getFunctionName() 30 | { 31 | return "asin"; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#evaluateMathFunction(double) 36 | */ 37 | @Override 38 | protected double evaluateMathFunction(double num) 39 | { 40 | return Math.asin(num); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/FloorFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function FLOOR(numExpr). 22 | */ 23 | public class FloorFunction extends MathFunction 24 | { 25 | /* (non-Javadoc) 26 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#getFunctionName() 27 | */ 28 | @Override 29 | protected String getFunctionName() 30 | { 31 | return "floor"; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#evaluateMathFunction(double) 36 | */ 37 | @Override 38 | protected double evaluateMathFunction(double num) 39 | { 40 | return Math.floor(num); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/TangentFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function TAN(numExpr). 22 | */ 23 | public class TangentFunction extends MathFunction 24 | { 25 | /* (non-Javadoc) 26 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#getFunctionName() 27 | */ 28 | @Override 29 | protected String getFunctionName() 30 | { 31 | return "tan"; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#evaluateMathFunction(double) 36 | */ 37 | @Override 38 | protected double evaluateMathFunction(double num) 39 | { 40 | return Math.tan(num); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/DurationLongConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | import java.time.Duration; 21 | 22 | /** 23 | * Class to handle the conversion between java.time.Duration and a Long form. 24 | */ 25 | public class DurationLongConverter implements TypeConverter 26 | { 27 | private static final long serialVersionUID = 8560242792431943497L; 28 | 29 | public Duration toMemberType(Long val) 30 | { 31 | if (val == null) 32 | { 33 | return null; 34 | } 35 | 36 | return Duration.ofSeconds(val); 37 | } 38 | 39 | public Long toDatastoreType(Duration date) 40 | { 41 | return date != null ? date.getSeconds() : null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/InstantStringConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | import java.time.Instant; 21 | 22 | /** 23 | * Class to handle the conversion between java.time.Instant and a String form. 24 | */ 25 | public class InstantStringConverter implements TypeConverter 26 | { 27 | private static final long serialVersionUID = -7199337848739020294L; 28 | 29 | public Instant toMemberType(String str) 30 | { 31 | if (str == null) 32 | { 33 | return null; 34 | } 35 | 36 | return Instant.parse(str); 37 | } 38 | 39 | public String toDatastoreType(Instant inst) 40 | { 41 | return inst != null ? inst.toString() : null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/compiler/QueryCompilerSyntaxException.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.compiler; 19 | 20 | import org.datanucleus.exceptions.NucleusUserException; 21 | 22 | /** 23 | * Exception thrown when a query compiler finds an error relative to the expected syntax. 24 | */ 25 | public class QueryCompilerSyntaxException extends NucleusUserException 26 | { 27 | private static final long serialVersionUID = -6782292145897186002L; 28 | 29 | public QueryCompilerSyntaxException(String msg, int position, String stringToCompile) 30 | { 31 | super(msg + " at character " + (position + 1) + " in \"" + stringToCompile + '"'); 32 | } 33 | 34 | public QueryCompilerSyntaxException(String msg) 35 | { 36 | super(msg); 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/ArcCosineFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function ACOS(numExpr). 22 | */ 23 | public class ArcCosineFunction extends MathFunction 24 | { 25 | /* (non-Javadoc) 26 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#getFunctionName() 27 | */ 28 | @Override 29 | protected String getFunctionName() 30 | { 31 | return "acos"; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#evaluateMathFunction(double) 36 | */ 37 | @Override 38 | protected double evaluateMathFunction(double num) 39 | { 40 | return Math.acos(num); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/DurationStringConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | import java.time.Duration; 21 | 22 | /** 23 | * Class to handle the conversion between java.time.Duration and a String form. 24 | */ 25 | public class DurationStringConverter implements TypeConverter 26 | { 27 | private static final long serialVersionUID = -7438116766732450791L; 28 | 29 | public Duration toMemberType(String str) 30 | { 31 | if (str == null) 32 | { 33 | return null; 34 | } 35 | 36 | return Duration.parse(str); 37 | } 38 | 39 | public String toDatastoreType(Duration dur) 40 | { 41 | return dur != null ? dur.toString() : null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/types/converters/SqlTimestampLongConverter.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.types.converters; 19 | 20 | import java.sql.Timestamp; 21 | 22 | /** 23 | * Class to handle the conversion between java.sql.Timestamp and a Long form. 24 | */ 25 | public class SqlTimestampLongConverter implements TypeConverter 26 | { 27 | private static final long serialVersionUID = 1415324665726138972L; 28 | 29 | public Timestamp toMemberType(Long value) 30 | { 31 | if (value == null) 32 | { 33 | return null; 34 | } 35 | 36 | return new java.sql.Timestamp(value); 37 | } 38 | 39 | public Long toDatastoreType(Timestamp ts) 40 | { 41 | return ts != null ? ts.getTime() : null; 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/exceptions/TransactionIsolationNotSupportedException.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2008 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.exceptions; 19 | 20 | import org.datanucleus.util.Localiser; 21 | 22 | /** 23 | * An exception thrown when an unsupported transaction isolation level is requested. 24 | */ 25 | public class TransactionIsolationNotSupportedException extends NucleusUserException 26 | { 27 | private static final long serialVersionUID = 6916529341358743847L; 28 | 29 | /** 30 | * Constructs a transaction already active exception with the specified detail message. 31 | * @param level Isolation level 32 | */ 33 | public TransactionIsolationNotSupportedException(String level) 34 | { 35 | super(Localiser.msg("015043", level)); 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/ArcTangentFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function ATAN(numExpr). 22 | */ 23 | public class ArcTangentFunction extends MathFunction 24 | { 25 | /* (non-Javadoc) 26 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#getFunctionName() 27 | */ 28 | @Override 29 | protected String getFunctionName() 30 | { 31 | return "atan"; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#evaluateMathFunction(double) 36 | */ 37 | @Override 38 | protected double evaluateMathFunction(double num) 39 | { 40 | return Math.atan(num); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/DegreesFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function DEGREES(numExpr). 22 | */ 23 | public class DegreesFunction extends MathFunction 24 | { 25 | /* (non-Javadoc) 26 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#getFunctionName() 27 | */ 28 | @Override 29 | protected String getFunctionName() 30 | { 31 | return "degrees"; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#evaluateMathFunction(double) 36 | */ 37 | @Override 38 | protected double evaluateMathFunction(double num) 39 | { 40 | return Math.toDegrees(num); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/RadiansFunction.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2012 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | /** 21 | * Evaluator for the function RADIANS(numExpr). 22 | */ 23 | public class RadiansFunction extends MathFunction 24 | { 25 | /* (non-Javadoc) 26 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#getFunctionName() 27 | */ 28 | @Override 29 | protected String getFunctionName() 30 | { 31 | return "radians"; 32 | } 33 | 34 | /* (non-Javadoc) 35 | * @see org.datanucleus.query.evaluator.memory.MathFunctionEvaluator#evaluateMathFunction(double) 36 | */ 37 | @Override 38 | protected double evaluateMathFunction(double num) 39 | { 40 | return Math.toRadians(num); 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/org/datanucleus/store/query/inmemory/method/ArcTangent2Function.java: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Copyright (c) 2022 Andy Jefferson and others. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contributors: 16 | ... 17 | **********************************************************************/ 18 | package org.datanucleus.store.query.inmemory.method; 19 | 20 | import org.datanucleus.exceptions.NucleusUserException; 21 | 22 | /** 23 | * Evaluator for the function ATAN2(numExpr). 24 | */ 25 | public class ArcTangent2Function extends MathFunction 26 | { 27 | @Override 28 | protected String getFunctionName() 29 | { 30 | return "atan2"; 31 | } 32 | 33 | @Override 34 | protected double evaluateMathFunction(double num) 35 | { 36 | throw new NucleusUserException("Attempt to invoke ATAN2 with single argument"); 37 | } 38 | 39 | @Override 40 | protected double evaluateMathFunction(double num1, double num2) 41 | { 42 | return Math.atan2(num1, num2); 43 | } 44 | } --------------------------------------------------------------------------------