├── usertype.core ├── src │ ├── test │ │ ├── resources │ │ │ ├── expected │ │ │ │ ├── .dbunit-comparison-files │ │ │ │ ├── unit.dtd │ │ │ │ ├── year.dtd │ │ │ │ ├── unit.xml │ │ │ │ ├── minute.dtd │ │ │ │ ├── quantity.xml │ │ │ │ ├── currency.dtd │ │ │ │ ├── dateTime.dtd │ │ │ │ ├── monthDay.dtd │ │ │ │ ├── quantity.dtd │ │ │ │ ├── localDate.dtd │ │ │ │ ├── localTime.dtd │ │ │ │ ├── legacyDate.dtd │ │ │ │ ├── moneyAmount.dtd │ │ │ │ ├── monthAsString.dtd │ │ │ │ ├── yearAsInteger.dtd │ │ │ │ ├── currencyUnit.dtd │ │ │ │ ├── monthAsInteger.dtd │ │ │ │ ├── periodAsString.dtd │ │ │ │ ├── bigMoneyAmount.dtd │ │ │ │ ├── instantAsString.dtd │ │ │ │ ├── localDateTime.dtd │ │ │ │ ├── periodAsString2.dtd │ │ │ │ ├── durationAsString.dtd │ │ │ │ ├── interval.dtd │ │ │ │ ├── isoCountryCode.dtd │ │ │ │ ├── moneyMajorAmount.dtd │ │ │ │ ├── moneyMinorAmount.dtd │ │ │ │ ├── timeZoneAsString.dtd │ │ │ │ ├── dayOfWeekAsString.dtd │ │ │ │ ├── legacyTimestamp.dtd │ │ │ │ ├── localDateAsString.dtd │ │ │ │ ├── localTimeAsString.dtd │ │ │ │ ├── quantityAndUnit.xml │ │ │ │ ├── yearMonthAsString.dtd │ │ │ │ ├── dayOfWeekAsInteger.dtd │ │ │ │ ├── instantAsMillisLong.dtd │ │ │ │ ├── instantAsTimestamp.dtd │ │ │ │ ├── bigMoneyMajorAmount.dtd │ │ │ │ ├── bigMoneyMinorAmount.dtd │ │ │ │ ├── zonedOffsetAsString.dtd │ │ │ │ ├── dateMidnight.dtd │ │ │ │ ├── dateTimeZoneAsString.dtd │ │ │ │ ├── localTimeAsNanosLong.dtd │ │ │ │ ├── localTimeAsTimestamp.dtd │ │ │ │ ├── currencyUnitAsInteger.dtd │ │ │ │ ├── legacyDate.xml │ │ │ │ ├── localDateTimeAsString.dtd │ │ │ │ ├── quantityAndUnit.dtd │ │ │ │ ├── instantAsNanosBigInteger.dtd │ │ │ │ ├── localTimeAsMillisInteger.dtd │ │ │ │ ├── dateTimeAsString.dtd │ │ │ │ ├── instantAsMillisLong.xml │ │ │ │ ├── instantAsString.xml │ │ │ │ ├── isoCountryCodeWithGeneric.dtd │ │ │ │ ├── dateMidnightAsString.dtd │ │ │ │ ├── monthAsInteger.xml │ │ │ │ ├── instantAsTimestamp.xml │ │ │ │ ├── legacyTimestamp.xml │ │ │ │ ├── moneyAmountAndCurAsInt.dtd │ │ │ │ ├── moneyAmountAndCurrency.dtd │ │ │ │ ├── monthAsString.xml │ │ │ │ ├── e164PhoneNumberWithExtension.dtd │ │ │ │ ├── instantAsNanosBigInteger.xml │ │ │ │ ├── bigMoneyAmountAndCurAsInt.dtd │ │ │ │ ├── bigMoneyAmountAndCurrency.dtd │ │ │ │ ├── dateTimeAndZoneWithOffset.dtd │ │ │ │ ├── localDateTimeAsString.xml │ │ │ │ ├── dayOfWeekAsInteger.xml │ │ │ │ ├── moneyMajorAmountAndCurAsInt.dtd │ │ │ │ ├── moneyMajorAmountAndCurrency.dtd │ │ │ │ ├── moneyMinorAmountAndCurAsInt.dtd │ │ │ │ ├── moneyMinorAmountAndCurrency.dtd │ │ │ │ ├── dateMidnight.xml │ │ │ │ ├── dateTimeZoneAsString.xml │ │ │ │ ├── dayOfWeekAsString.xml │ │ │ │ ├── bigMoneyMajorAmountAndCurAsInt.dtd │ │ │ │ ├── bigMoneyMajorAmountAndCurrency.dtd │ │ │ │ ├── bigMoneyMinorAmountAndCurAsInt.dtd │ │ │ │ ├── bigMoneyMinorAmountAndCurrency.dtd │ │ │ │ ├── moneyAmount.xml │ │ │ │ ├── offsetTimeAsLongAndStringOffset.dtd │ │ │ │ ├── offsetTimeAsTimeAndStringOffset.dtd │ │ │ │ ├── offsetTimeAsStringAndStringOffset.dtd │ │ │ │ ├── bigMoneyAmount.xml │ │ │ │ ├── moneyMajorAmount.xml │ │ │ │ ├── moneyMinorAmount.xml │ │ │ │ ├── offsetDateTimeAsStringAndStringOffset.dtd │ │ │ │ ├── currency.xml │ │ │ │ ├── dateMidnightAsString.xml │ │ │ │ ├── dateTimeAsString.xml │ │ │ │ ├── bigMoneyMajorAmount.xml │ │ │ │ ├── bigMoneyMinorAmount.xml │ │ │ │ ├── zonedDateTimeAsStringStringOffsetAndStringZone.dtd │ │ │ │ ├── interval.xml │ │ │ │ ├── offsetDateTimeAsStringAndStringOffset.xml │ │ │ │ ├── currencyUnit.xml │ │ │ │ ├── isoCountryCode.xml │ │ │ │ ├── e164PhoneNumberWithExtension.xml │ │ │ │ ├── currencyUnitAsInteger.xml │ │ │ │ ├── isoCountryCodeWithGeneric.xml │ │ │ │ ├── moneyAmountAndCurAsInt.xml │ │ │ │ ├── moneyAmountAndCurrency.xml │ │ │ │ ├── bigMoneyAmountAndCurAsInt.xml │ │ │ │ ├── bigMoneyAmountAndCurrency.xml │ │ │ │ ├── moneyMajorAmountAndCurAsInt.xml │ │ │ │ ├── moneyMinorAmountAndCurAsInt.xml │ │ │ │ ├── moneyMajorAmountAndCurrency.xml │ │ │ │ ├── moneyMinorAmountAndCurrency.xml │ │ │ │ ├── bigMoneyMajorAmountAndCurAsInt.xml │ │ │ │ ├── bigMoneyMajorAmountAndCurrency.xml │ │ │ │ ├── bigMoneyMinorAmountAndCurAsInt.xml │ │ │ │ ├── bigMoneyMinorAmountAndCurrency.xml │ │ │ │ ├── localDate.xml │ │ │ │ ├── year.xml │ │ │ │ ├── minute.xml │ │ │ │ ├── timeZoneAsString.xml │ │ │ │ ├── localDateAsString.xml │ │ │ │ ├── localDateTime.xml │ │ │ │ ├── monthDay.xml │ │ │ │ ├── dateTime.xml │ │ │ │ ├── yearAsInteger.xml │ │ │ │ ├── localTime.xml │ │ │ │ ├── localTimeAsString.xml │ │ │ │ ├── yearMonthAsString.xml │ │ │ │ ├── offsetTimeAsTimeAndStringOffset.xml │ │ │ │ ├── localTimeAsNanosLong.xml │ │ │ │ ├── localTimeAsMillisInteger.xml │ │ │ │ ├── offsetTimeAsLongAndStringOffset.xml │ │ │ │ ├── offsetTimeAsStringAndStringOffset.xml │ │ │ │ ├── periodAsString.xml │ │ │ │ ├── durationAsString.xml │ │ │ │ ├── localTimeAsTimestamp.xml │ │ │ │ ├── dateTimeAndZoneWithOffset.xml │ │ │ │ ├── zonedOffsetAsString.xml │ │ │ │ ├── zonedDateTimeAsStringStringOffsetAndStringZone.xml │ │ │ │ └── periodAsString2.xml │ │ │ └── log4j.properties │ │ └── java │ │ │ └── org │ │ │ └── jadira │ │ │ └── usertype │ │ │ ├── country │ │ │ └── TestCountrySuite.java │ │ │ ├── corejava │ │ │ └── enumerated │ │ │ │ └── TestCoreJavaSuite.java │ │ │ ├── phonenumber │ │ │ └── TestPhoneNumberSuite.java │ │ │ ├── moneyandcurrency │ │ │ ├── legacyjdk │ │ │ │ └── TestLegacyJdkMoneySuite.java │ │ │ └── moneta │ │ │ │ └── TestMonetaMoneySuite.java │ │ │ ├── dateandtime │ │ │ ├── legacyjdk │ │ │ │ └── TestLegacyJdkSuite.java │ │ │ └── threeten │ │ │ │ └── columnmapper │ │ │ │ └── BigIntegerColumnInstantMapperTest.java │ │ │ └── unitsofmeaurement │ │ │ └── indriya │ │ │ └── TestIndriyaSuite.java │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── org.hibernate.integrator.spi.Integrator │ │ └── java │ │ └── org │ │ └── jadira │ │ └── usertype │ │ ├── country │ │ └── PersistentISOCountryCode.java │ │ ├── moneyandcurrency │ │ ├── moneta │ │ │ ├── util │ │ │ │ └── CurrencyUnitConfigured.java │ │ │ └── PersistentCurrencyUnit.java │ │ ├── joda │ │ │ ├── util │ │ │ │ └── CurrencyUnitConfigured.java │ │ │ ├── PersistentCurrencyUnit.java │ │ │ └── PersistentCurrencyUnitAsInteger.java │ │ └── legacyjdk │ │ │ └── PersistentCurrency.java │ │ ├── unitsofmeasurement │ │ └── indriya │ │ │ ├── util │ │ │ └── UnitConfigured.java │ │ │ └── columnmapper │ │ │ └── StringColumnStringMapper.java │ │ └── dateandtime │ │ ├── joda │ │ ├── util │ │ │ └── ZoneHelper.java │ │ ├── PersistentYears.java │ │ ├── PersistentInstantAsString.java │ │ ├── PersistentMinutes.java │ │ ├── PersistentMonthDayAsString.java │ │ ├── PersistentLocalDateAsString.java │ │ ├── PersistentYearMonthAsString.java │ │ ├── PersistentLocalDateTimeAsString.java │ │ ├── PersistentDateTimeZoneAsString.java │ │ ├── PersistentDurationAsMillisLong.java │ │ └── PersistentDurationAsNanosBigInteger.java │ │ └── threeten │ │ ├── PersistentMonthAsString.java │ │ ├── PersistentYearAsString.java │ │ ├── PersistentInstantAsString.java │ │ ├── PersistentYearAsInteger.java │ │ ├── PersistentMonthDayAsString.java │ │ ├── PersistentDayOfWeekAsString.java │ │ ├── PersistentMonthAsInteger.java │ │ ├── PersistentZoneIdAsString.java │ │ ├── PersistentLocalDateAsString.java │ │ ├── PersistentYearMonthAsString.java │ │ ├── PersistentDayOfWeekAsInteger.java │ │ ├── PersistentZoneOffsetAsString.java │ │ ├── PersistentLocalDateTimeAsString.java │ │ ├── columnmapper │ │ ├── StringColumnZoneIdMapper.java │ │ ├── StringColumnDurationMapper.java │ │ └── StringColumnMonthDayMapper.java │ │ └── PersistentDurationAsMillisLong.java └── maven-eclipse.xml ├── dictionary.txt ├── src ├── changes │ └── changes.xml └── site │ ├── resources │ └── images │ │ └── jadira-small.png │ ├── fml │ └── faqs.fml │ └── xdoc │ └── licensecover.xml ├── bindings └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ ├── services │ │ │ ├── javax.enterprise.inject.spi.Extension │ │ │ └── org.jadira.bindings.core.binder.Binder │ │ │ └── bindings.xml │ └── java │ │ └── org │ │ └── jadira │ │ └── bindings │ │ └── core │ │ ├── binder │ │ └── Binder.java │ │ ├── api │ │ └── Binding.java │ │ ├── provider │ │ └── StandardConverterProvider.java │ │ └── jdk │ │ ├── ByteStringBinding.java │ │ ├── StringStringBinding.java │ │ ├── LongStringBinding.java │ │ ├── BooleanStringBinding.java │ │ ├── FloatStringBinding.java │ │ ├── ShortStringBinding.java │ │ └── URIStringBinding.java │ └── test │ ├── resources │ ├── META-INF │ │ ├── beans.xml │ │ └── bindings.xml │ ├── log4j.properties │ └── another-bindings.xml │ └── java │ └── org │ └── jadira │ └── bindings │ └── core │ ├── utils │ └── reflection │ │ └── ClassLoaderUtilsTest.java │ ├── test │ ├── Narrow.java │ └── SubjectB.java │ └── jdk │ ├── StringStringBindingTest.java │ └── CharSequenceStringBindingTest.java ├── cloning └── src │ ├── test │ ├── java │ │ └── org │ │ │ └── jadira │ │ │ └── cloning │ │ │ └── data │ │ │ ├── ExampleEnum.java │ │ │ ├── ReferencesHolder.java │ │ │ ├── DeepCopyHolder.java │ │ │ └── IdHolder.java │ └── resources │ │ └── log4j2-test.xml │ └── main │ └── java │ └── org │ └── jadira │ └── reflection │ ├── access │ ├── api │ │ ├── ClassAccessFactory.java │ │ └── MethodAccess.java │ ├── asm │ │ └── AsmClassAccessFactory.java │ ├── unsafe │ │ └── UnsafeClassAccessFactory.java │ ├── portable │ │ └── PortableClassAccessFactory.java │ ├── invokedynamic │ │ └── InvokeDynamicClassAccessFactory.java │ └── model │ │ └── FieldType.java │ ├── cloning │ ├── api │ │ ├── NoCloneImplementor.java │ │ └── CloneStrategy.java │ └── annotation │ │ └── Immutable.java │ └── core │ └── identity │ └── Tuple.java ├── scanner └── src │ └── main │ ├── java │ └── org │ │ └── jadira │ │ └── scanner │ │ ├── core │ │ ├── api │ │ │ ├── Allocator.java │ │ │ ├── Locator.java │ │ │ ├── Projector.java │ │ │ ├── Resolver.java │ │ │ └── Filter.java │ │ ├── helper │ │ │ ├── FileInputStreamOperation.java │ │ │ ├── InputStreamOperation.java │ │ │ └── filenamefilter │ │ │ │ └── JarFilenameFilter.java │ │ ├── filter │ │ │ └── AbstractFilter.java │ │ └── concurrent │ │ │ ├── FilterTask.java │ │ │ ├── AllocatorTask.java │ │ │ └── ProjectorTask.java │ │ ├── classpath │ │ ├── filter │ │ │ ├── JElementTypeFilter.java │ │ │ └── NameFilter.java │ │ └── api │ │ │ └── JClassFilter.java │ │ ├── file │ │ └── locator │ │ │ └── IdentityUrlLocator.java │ │ └── classfile │ │ └── filter │ │ └── NameFilter.java │ └── resources │ ├── java-Oracle_Corporation-1_7_0_09_lib_ext_dnsns_jar.classes │ ├── java-Oracle_Corporation-1_7_0_09_lib_ext_sunec_jar.classes │ └── java-Oracle_Corporation-1_7_0_09_lib_ext_sunmscapi_jar.classes ├── maven └── fmpp-maven-plugin │ └── src │ └── main │ └── resources │ └── META-INF │ └── beans.xml ├── usertype.spi ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── jadira │ │ │ └── usertype │ │ │ └── spi │ │ │ ├── shared │ │ │ ├── JavaZoneConfigured.java │ │ │ ├── Jdbc42Configured.java │ │ │ ├── ValidTypesConfigured.java │ │ │ ├── DatabaseZoneConfigured.java │ │ │ ├── VersionableColumnMapper.java │ │ │ ├── ColumnMapper.java │ │ │ └── AbstractVersionableTimestampColumnMapper.java │ │ │ ├── timezone │ │ │ └── proxy │ │ │ │ ├── WrapsSession.java │ │ │ │ └── TimeZoneProvidingSharedSessionContractImplementor.java │ │ │ └── utils │ │ │ └── lang │ │ │ ├── StringUtils.java │ │ │ └── AssertionException.java │ └── test │ │ └── java │ │ └── org │ │ └── jadira │ │ └── usertype │ │ └── dateandtime │ │ └── shared │ │ └── dbunit │ │ └── RuntimeDatabaseUnitException.java └── maven-eclipse.xml ├── cdt ├── maven-eclipse.xml └── src │ └── main │ └── resources │ └── freemarker │ └── config.fmpp ├── suppressions.xml ├── howto_release.txt ├── jms └── src │ └── test │ └── resources │ └── log4j2-test.xml └── quant └── src └── main └── java └── org └── jadira └── quant └── api └── QuantitativeFunction.java /usertype.core/src/test/resources/expected/.dbunit-comparison-files: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dictionary.txt: -------------------------------------------------------------------------------- 1 | apache 2 | 3 | christopher 4 | 5 | hibernate 6 | pheby 7 | 8 | -------------------------------------------------------------------------------- /src/changes/changes.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JadiraOrg/jadira/HEAD/src/changes/changes.xml -------------------------------------------------------------------------------- /bindings/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | org.jadira.bindings.core.cdi.BinderExtension -------------------------------------------------------------------------------- /bindings/src/main/resources/META-INF/services/org.jadira.bindings.core.binder.Binder: -------------------------------------------------------------------------------- 1 | org.jadira.bindings.core.binder.BasicBinder -------------------------------------------------------------------------------- /src/site/resources/images/jadira-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JadiraOrg/jadira/HEAD/src/site/resources/images/jadira-small.png -------------------------------------------------------------------------------- /cloning/src/test/java/org/jadira/cloning/data/ExampleEnum.java: -------------------------------------------------------------------------------- 1 | package org.jadira.cloning.data; 2 | 3 | public enum ExampleEnum 4 | { 5 | A, B, C, D, E, F, G 6 | } 7 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/api/Allocator.java: -------------------------------------------------------------------------------- 1 | package org.jadira.scanner.core.api; 2 | 3 | public interface Allocator { 4 | 5 | T allocate(E e); 6 | } 7 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/unit.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/year.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /cloning/src/test/java/org/jadira/cloning/data/ReferencesHolder.java: -------------------------------------------------------------------------------- 1 | package org.jadira.cloning.data; 2 | 3 | public class ReferencesHolder { 4 | 5 | public Object ref1; 6 | public Object ref2; 7 | public Object ref3; 8 | public Object ref4; 9 | } -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/unit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/minute.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/quantity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/currency.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateTime.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/monthDay.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/quantity.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localDate.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localTime.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/legacyDate.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyAmount.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/monthAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/yearAsInteger.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/currencyUnit.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/monthAsInteger.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/periodAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /maven/fmpp-maven-plugin/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyAmount.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/instantAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localDateTime.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/periodAsString2.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/helper/FileInputStreamOperation.java: -------------------------------------------------------------------------------- 1 | package org.jadira.scanner.core.helper; 2 | 3 | import java.io.InputStream; 4 | 5 | public interface FileInputStreamOperation { 6 | 7 | T execute(String path, InputStream fileInputStream); 8 | } 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/durationAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/interval.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/isoCountryCode.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMajorAmount.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMinorAmount.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/timeZoneAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dayOfWeekAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/legacyTimestamp.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localDateAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localTimeAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/quantityAndUnit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/yearMonthAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dayOfWeekAsInteger.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/instantAsMillisLong.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/instantAsTimestamp.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMajorAmount.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMinorAmount.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/zonedOffsetAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateMidnight.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateTimeZoneAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localTimeAsNanosLong.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localTimeAsTimestamp.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/currencyUnitAsInteger.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/legacyDate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localDateTimeAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/quantityAndUnit.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.spi/src/main/java/org/jadira/usertype/spi/shared/JavaZoneConfigured.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.spi.shared; 2 | 3 | /** 4 | * @author Chris 5 | */ 6 | public interface JavaZoneConfigured { 7 | 8 | void setJavaZone(T javaZone); 9 | 10 | T parseJavaZone(String zoneString); 11 | } -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/instantAsNanosBigInteger.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.spi/src/main/java/org/jadira/usertype/spi/shared/Jdbc42Configured.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.spi.shared; 2 | 3 | 4 | /** 5 | * Indicates a user type can be configured to use the JDBC 4.2 API 6 | */ 7 | public interface Jdbc42Configured { 8 | 9 | void setUseJdbc42Apis(boolean useJdbc42Apis); 10 | } -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localTimeAsMillisInteger.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.spi/src/main/java/org/jadira/usertype/spi/shared/ValidTypesConfigured.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.spi.shared; 2 | 3 | import java.util.List; 4 | 5 | public interface ValidTypesConfigured { 6 | 7 | void setValidTypes(List> types); 8 | 9 | public List> getValidTypes(); 10 | } 11 | -------------------------------------------------------------------------------- /cdt/maven-eclipse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateTimeAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/instantAsMillisLong.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/instantAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/isoCountryCodeWithGeneric.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/maven-eclipse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateMidnightAsString.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/monthAsInteger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /usertype.spi/maven-eclipse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bindings/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/instantAsTimestamp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/legacyTimestamp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyAmountAndCurAsInt.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyAmountAndCurrency.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/monthAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /usertype.spi/src/main/java/org/jadira/usertype/spi/timezone/proxy/WrapsSession.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.spi.timezone.proxy; 2 | 3 | import org.hibernate.engine.spi.SharedSessionContractImplementor; 4 | 5 | public interface WrapsSession { 6 | 7 | public SharedSessionContractImplementor wrapSession(SharedSessionContractImplementor target); 8 | } 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/e164PhoneNumberWithExtension.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/instantAsNanosBigInteger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /scanner/src/main/resources/java-Oracle_Corporation-1_7_0_09_lib_ext_dnsns_jar.classes: -------------------------------------------------------------------------------- 1 | sun/net/spi/nameservice/dns/DNSNameService$1.class 2 | sun/net/spi/nameservice/dns/DNSNameService$2.class 3 | sun/net/spi/nameservice/dns/DNSNameService$ThreadContext.class 4 | sun/net/spi/nameservice/dns/DNSNameService.class 5 | sun/net/spi/nameservice/dns/DNSNameServiceDescriptor.class -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyAmountAndCurAsInt.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyAmountAndCurrency.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateTimeAndZoneWithOffset.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localDateTimeAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dayOfWeekAsInteger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMajorAmountAndCurAsInt.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMajorAmountAndCurrency.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMinorAmountAndCurAsInt.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMinorAmountAndCurrency.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateMidnight.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateTimeZoneAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dayOfWeekAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMajorAmountAndCurAsInt.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMajorAmountAndCurrency.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMinorAmountAndCurAsInt.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMinorAmountAndCurrency.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyAmount.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/offsetTimeAsLongAndStringOffset.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/offsetTimeAsTimeAndStringOffset.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/offsetTimeAsStringAndStringOffset.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyAmount.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMajorAmount.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMinorAmount.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/offsetDateTimeAsStringAndStringOffset.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/currency.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateMidnightAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /cloning/src/test/java/org/jadira/cloning/data/DeepCopyHolder.java: -------------------------------------------------------------------------------- 1 | package org.jadira.cloning.data; 2 | 3 | import java.util.Calendar; 4 | 5 | import javax.xml.datatype.XMLGregorianCalendar; 6 | 7 | public class DeepCopyHolder { 8 | 9 | public IdHolder value; 10 | 11 | public java.sql.Timestamp timestamp; 12 | public Calendar calendar; 13 | public transient XMLGregorianCalendar xmlCalendar; 14 | } -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateTimeAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMajorAmount.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMinorAmount.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/zonedDateTimeAsStringStringOffsetAndStringZone.dtd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/interval.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/offsetDateTimeAsStringAndStringOffset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/currencyUnit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/isoCountryCode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/e164PhoneNumberWithExtension.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /cloning/src/main/java/org/jadira/reflection/access/api/ClassAccessFactory.java: -------------------------------------------------------------------------------- 1 | package org.jadira.reflection.access.api; 2 | 3 | /** 4 | * Defines a Factory for ClassAccess instances 5 | */ 6 | public interface ClassAccessFactory { 7 | 8 | /** 9 | * Get a class access instance for the given class 10 | * @param clazz The class 11 | * @param The type of class 12 | * @return The ClassAccess instance 13 | */ 14 | ClassAccess getClassAccess(Class clazz); 15 | } 16 | -------------------------------------------------------------------------------- /bindings/src/test/java/org/jadira/bindings/core/utils/reflection/ClassLoaderUtilsTest.java: -------------------------------------------------------------------------------- 1 | package org.jadira.bindings.core.utils.reflection; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import org.junit.Test; 6 | 7 | public class ClassLoaderUtilsTest { 8 | 9 | @Test 10 | public void testGetClassLoader() { 11 | 12 | assertEquals("sun.misc.Launcher$AppClassLoader", ClassLoaderUtils.getClassLoader().getClass().getName()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /bindings/src/test/java/org/jadira/bindings/core/test/Narrow.java: -------------------------------------------------------------------------------- 1 | package org.jadira.bindings.core.test; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | import org.jadira.bindings.core.annotation.BindingScope; 9 | 10 | @Target(ElementType.METHOD) 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @BindingScope 13 | public @interface Narrow { 14 | } 15 | -------------------------------------------------------------------------------- /usertype.spi/src/main/java/org/jadira/usertype/spi/utils/lang/StringUtils.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.spi.utils.lang; 2 | 3 | public final class StringUtils { 4 | 5 | private StringUtils() { 6 | } 7 | 8 | public static boolean isEmpty(String string) { 9 | 10 | if (string == null || string.length() == 0) { 11 | return true; 12 | } else { 13 | return false; 14 | } 15 | } 16 | 17 | public static boolean isNotEmpty(String string) { 18 | return !isEmpty(string); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/currencyUnitAsInteger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.spi/src/main/java/org/jadira/usertype/spi/shared/DatabaseZoneConfigured.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.spi.shared; 2 | 3 | import java.util.TimeZone; 4 | 5 | import org.jadira.usertype.spi.timezone.proxy.WrapsSession; 6 | 7 | /** 8 | * @author Chris 9 | */ 10 | public interface DatabaseZoneConfigured extends WrapsSession { 11 | 12 | void setDatabaseZone(TimeZone databaseZone); 13 | 14 | TimeZone parseZone(String zoneString); 15 | 16 | public TimeZone getDatabaseZone(); 17 | } -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/filter/AbstractFilter.java: -------------------------------------------------------------------------------- 1 | package org.jadira.scanner.core.filter; 2 | 3 | import org.jadira.scanner.core.api.Filter; 4 | import org.jadira.scanner.core.spi.TypeHelper; 5 | 6 | public abstract class AbstractFilter implements Filter { 7 | 8 | @Override 9 | public Class targetType() { 10 | @SuppressWarnings("unchecked") 11 | final Class result = (Class)TypeHelper.getTypeArguments(AbstractFilter.class, this.getClass()).get(0); 12 | return result; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /scanner/src/main/resources/java-Oracle_Corporation-1_7_0_09_lib_ext_sunec_jar.classes: -------------------------------------------------------------------------------- 1 | sun/security/ec/ECKeyPairGenerator.class 2 | sun/security/ec/ECDSASignature$SHA1.class 3 | sun/security/ec/ECDSASignature.class 4 | sun/security/ec/ECDSASignature$SHA384.class 5 | sun/security/ec/SunECEntries.class 6 | sun/security/ec/ECDSASignature$SHA256.class 7 | sun/security/ec/ECDSASignature$Raw.class 8 | sun/security/ec/SunEC$1.class 9 | sun/security/ec/ECDSASignature$SHA512.class 10 | sun/security/ec/SunEC.class 11 | sun/security/ec/ECDHKeyAgreement.class -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/isoCountryCodeWithGeneric.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/main/resources/META-INF/services/org.hibernate.integrator.spi.Integrator: -------------------------------------------------------------------------------- 1 | org.jadira.usertype.dateandtime.joda.integrator.UserTypeJodaTimeHibernateIntegrator 2 | org.jadira.usertype.moneyandcurrency.joda.integrator.UserTypeJodaMoneyHibernateIntegrator 3 | org.jadira.usertype.moneyandcurrency.legacyjdk.integrator.UserTypeLegacyJdkMoneyHibernateIntegrator 4 | org.jadira.usertype.dateandtime.threeten.integrator.UserTypeThreeTenHibernateIntegrator 5 | org.jadira.usertype.moneyandcurrency.moneta.integrator.UserTypeMonetaMoneyHibernateIntegrator -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/country/PersistentISOCountryCode.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.country; 2 | 3 | import org.jadira.cdt.country.ISOCountryCode; 4 | import org.jadira.usertype.country.columnmapper.StringColumnISOCountryCodeMapper; 5 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 6 | 7 | public class PersistentISOCountryCode extends AbstractSingleColumnUserType { 8 | 9 | private static final long serialVersionUID = -306531073551665558L; 10 | } 11 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyAmountAndCurAsInt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyAmountAndCurrency.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyAmountAndCurAsInt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyAmountAndCurrency.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMajorAmountAndCurAsInt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMinorAmountAndCurAsInt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMajorAmountAndCurrency.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/moneyMinorAmountAndCurrency.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMajorAmountAndCurAsInt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMajorAmountAndCurrency.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMinorAmountAndCurAsInt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/bigMoneyMinorAmountAndCurrency.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cloning/src/main/java/org/jadira/reflection/access/asm/AsmClassAccessFactory.java: -------------------------------------------------------------------------------- 1 | package org.jadira.reflection.access.asm; 2 | 3 | import org.jadira.reflection.access.api.ClassAccess; 4 | import org.jadira.reflection.access.api.ClassAccessFactory; 5 | 6 | public class AsmClassAccessFactory implements ClassAccessFactory { 7 | 8 | public static final ClassAccessFactory FACTORY = new AsmClassAccessFactory(); 9 | 10 | private AsmClassAccessFactory() { 11 | } 12 | 13 | @Override 14 | public ClassAccess getClassAccess(Class clazz) { 15 | return AsmClassAccess.get(clazz); 16 | } 17 | 18 | public static ClassAccessFactory get() { 19 | return FACTORY; 20 | } 21 | } -------------------------------------------------------------------------------- /howto_release.txt: -------------------------------------------------------------------------------- 1 | 1) Prepare the release: 2 | 3 | mvn clean install 4 | mvn release:prepare -Dresume=false 5 | 6 | 2) Perform the release: 7 | 8 | mvn release:perform -P release-sign-artifacts 9 | 10 | 2a) This will fail. Then: 11 | 12 | cd target/checkout 13 | mvn clean install 14 | mvn deploy -P release-sign-artifacts -Dgpg.passphrase=password 15 | mvn site:site 16 | ssh -t username,jadira@shell.sf.net create 17 | exit 18 | mvn site:deploy 19 | 20 | 3) Promote the release: 21 | 22 | Log into http://oss.sonatype.org/ 23 | Select 'Staging Repositories' then 'org.jadira'... 24 | Close the Repository 25 | Release the Repository 26 | 27 | Sync-up with Maven central is automatic. -------------------------------------------------------------------------------- /cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeClassAccessFactory.java: -------------------------------------------------------------------------------- 1 | package org.jadira.reflection.access.unsafe; 2 | 3 | import org.jadira.reflection.access.api.ClassAccess; 4 | import org.jadira.reflection.access.api.ClassAccessFactory; 5 | 6 | public class UnsafeClassAccessFactory implements ClassAccessFactory { 7 | 8 | public static final ClassAccessFactory FACTORY = new UnsafeClassAccessFactory(); 9 | 10 | private UnsafeClassAccessFactory() { 11 | } 12 | 13 | @Override 14 | public ClassAccess getClassAccess(Class clazz) { 15 | return UnsafeClassAccess.get(clazz); 16 | } 17 | 18 | public static ClassAccessFactory get() { 19 | return FACTORY; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cloning/src/main/java/org/jadira/reflection/access/portable/PortableClassAccessFactory.java: -------------------------------------------------------------------------------- 1 | package org.jadira.reflection.access.portable; 2 | 3 | import org.jadira.reflection.access.api.ClassAccess; 4 | import org.jadira.reflection.access.api.ClassAccessFactory; 5 | 6 | public class PortableClassAccessFactory implements ClassAccessFactory { 7 | 8 | public static final ClassAccessFactory FACTORY = new PortableClassAccessFactory(); 9 | 10 | private PortableClassAccessFactory() { 11 | } 12 | 13 | @Override 14 | public ClassAccess getClassAccess(Class clazz) { 15 | return PortableClassAccess.get(clazz); 16 | } 17 | 18 | public static ClassAccessFactory get() { 19 | return FACTORY; 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /cloning/src/main/java/org/jadira/reflection/access/invokedynamic/InvokeDynamicClassAccessFactory.java: -------------------------------------------------------------------------------- 1 | package org.jadira.reflection.access.invokedynamic; 2 | 3 | import org.jadira.reflection.access.api.ClassAccess; 4 | import org.jadira.reflection.access.api.ClassAccessFactory; 5 | 6 | public class InvokeDynamicClassAccessFactory implements ClassAccessFactory { 7 | 8 | public static final ClassAccessFactory FACTORY = new InvokeDynamicClassAccessFactory(); 9 | 10 | private InvokeDynamicClassAccessFactory() { 11 | } 12 | 13 | @Override 14 | public ClassAccess getClassAccess(Class clazz) { 15 | return InvokeDynamicClassAccess.get(clazz); 16 | } 17 | 18 | public static ClassAccessFactory get() { 19 | return FACTORY; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cloning/src/test/java/org/jadira/cloning/data/IdHolder.java: -------------------------------------------------------------------------------- 1 | package org.jadira.cloning.data; 2 | 3 | 4 | public class IdHolder { 5 | 6 | private String id; 7 | 8 | public String getId() { 9 | return id; 10 | } 11 | 12 | public void setId(String id) { 13 | this.id = id; 14 | } 15 | 16 | @Override 17 | public boolean equals(Object that) { 18 | if (that instanceof IdHolder) { 19 | if (this.id == null && ((IdHolder) that).id == null) { 20 | return true; 21 | } else { 22 | return this.id.equals(((IdHolder) that).id); 23 | } 24 | } 25 | return false; 26 | } 27 | 28 | @Override 29 | public int hashCode() { 30 | int hash = 5; 31 | hash = 89 * hash + (this.id != null ? this.id.hashCode() : 0); 32 | return hash; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /jms/src/test/resources/log4j2-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /cloning/src/test/resources/log4j2-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /bindings/src/main/java/org/jadira/bindings/core/binder/Binder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.binder; 17 | 18 | public interface Binder extends SearchableBinder, ConversionBinder, StringBinder { 19 | } -------------------------------------------------------------------------------- /cdt/src/main/resources/freemarker/config.fmpp: -------------------------------------------------------------------------------- 1 | data: { 2 | countryCode: csv(countrynames.txt, {separator:';', trimCells:true, encoding:UTF-8, replaceHeaders:[alpha2Code, alpha3Code, numericCode:n, englishShortnameGazetteer, englishShortnameReading, englishRomanizedShortnameGazetteer, englishRomanizedShortnameReading, 3 | frenchShortnameGazetteer, frenchShortnameReading, spanishShortnameGazetteer, 4 | ungegnEnglishFormalName, ungegnFrenchFormalName, ungegnSpanishFormalName, ungegnRussianCyrillicShortName, ungegnRussianCyrillicFormalName, ungegnLocalShortName, ungegnLocalFormalName, 5 | faoItalianShortNameGazetteer, faoItalianShortNameReading, faoItalianOfficialName, bgnEnglishShortNameGazetteer, bgnEnglishShortNameReading, bgnEnglishLongName, bgnLocalShortName, bgnLocalLongName, 6 | pcgnEnglishShortNameGazetteer, pcgnEnglishShortNameReading, pcgnEnglishLongName ]}) 7 | } -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/api/Locator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.scanner.core.api; 17 | 18 | import java.util.List; 19 | 20 | public interface Locator { 21 | 22 | List locate(); 23 | } -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/api/Projector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.scanner.core.api; 17 | 18 | import java.util.List; 19 | 20 | public interface Projector { 21 | 22 | List project(T segment); 23 | } -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/concurrent/FilterTask.java: -------------------------------------------------------------------------------- 1 | package org.jadira.scanner.core.concurrent; 2 | 3 | import java.util.List; 4 | import java.util.stream.Collectors; 5 | 6 | import org.jadira.scanner.core.api.Filter; 7 | 8 | import jsr166y.RecursiveTask; 9 | 10 | public class FilterTask extends RecursiveTask> { 11 | 12 | private static final long serialVersionUID = 7688297986024541356L; 13 | 14 | private final Filter filter; 15 | private final List inputs; 16 | 17 | public FilterTask(final Integer limit, final Filter filter, final List inputs) { 18 | 19 | this.filter = filter; 20 | this.inputs = inputs; 21 | } 22 | 23 | @Override 24 | public List compute() { 25 | 26 | List result = inputs.stream() 27 | .filter( t -> filter.accept(t) ) 28 | .collect( Collectors.toList() ); 29 | 30 | return result; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /cloning/src/main/java/org/jadira/reflection/cloning/api/NoCloneImplementor.java: -------------------------------------------------------------------------------- 1 | package org.jadira.reflection.cloning.api; 2 | 3 | import java.util.IdentityHashMap; 4 | 5 | /** 6 | * This class is a placeholder to indicate the lack of CloneImplementor capability. 7 | * It is default CloneImplementor implementation for @Cloneable instances 8 | */ 9 | public class NoCloneImplementor implements CloneImplementor { 10 | 11 | @Override 12 | public T newInstance(Class c) { 13 | throw new UnsupportedOperationException("Should not be invoked"); 14 | } 15 | 16 | @Override 17 | public boolean canClone(Class clazz) { 18 | throw new UnsupportedOperationException("Should not be invoked"); 19 | } 20 | 21 | @Override 22 | public T clone(T obj, CloneDriver context, 23 | IdentityHashMap referencesToReuse, long stackDepth) { 24 | throw new UnsupportedOperationException("Should not be invoked"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/helper/InputStreamOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.scanner.core.helper; 17 | 18 | import java.io.InputStream; 19 | 20 | public interface InputStreamOperation { 21 | 22 | T execute(String identifier, InputStream fileInputStream); 23 | } 24 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/concurrent/AllocatorTask.java: -------------------------------------------------------------------------------- 1 | package org.jadira.scanner.core.concurrent; 2 | 3 | import java.util.List; 4 | import java.util.stream.Collectors; 5 | 6 | import org.jadira.scanner.core.api.Allocator; 7 | 8 | import jsr166y.RecursiveTask; 9 | 10 | public class AllocatorTask extends RecursiveTask> { 11 | 12 | private static final long serialVersionUID = -5338937563634945167L; 13 | 14 | private final Allocator allocator; 15 | private final List inputs; 16 | 17 | public AllocatorTask(final Allocator allocator, final List inputs) { 18 | 19 | this.allocator = allocator; 20 | this.inputs = inputs; 21 | } 22 | 23 | @Override 24 | public List compute() { 25 | 26 | List result = inputs.stream() 27 | .map( a -> allocator.allocate(a) ) 28 | .collect( Collectors.toList() ); 29 | 30 | return result; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localDate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /usertype.spi/src/main/java/org/jadira/usertype/spi/shared/VersionableColumnMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.spi.shared; 17 | 18 | public interface VersionableColumnMapper extends ColumnMapper { 19 | 20 | J generateCurrentValue(); 21 | } 22 | -------------------------------------------------------------------------------- /cloning/src/main/java/org/jadira/reflection/access/model/FieldType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.reflection.access.model; 17 | 18 | /** 19 | * Indicates whether a field contains a Primitive, an Array or an Object 20 | */ 21 | public enum FieldType { 22 | 23 | PRIMITIVE, 24 | ARRAY, 25 | OBJECT 26 | } -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/year.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/minute.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/timeZoneAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localDateAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /usertype.spi/src/main/java/org/jadira/usertype/spi/timezone/proxy/TimeZoneProvidingSharedSessionContractImplementor.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.spi.timezone.proxy; 2 | 3 | import java.util.TimeZone; 4 | 5 | import org.hibernate.engine.spi.SharedSessionContractImplementor; 6 | import org.jadira.usertype.spi.engine.AbstractProxySharedSessionContractImplementor; 7 | 8 | public class TimeZoneProvidingSharedSessionContractImplementor extends AbstractProxySharedSessionContractImplementor { 9 | 10 | private static final long serialVersionUID = -120329888642773756L; 11 | private TimeZone timezone; 12 | 13 | public TimeZoneProvidingSharedSessionContractImplementor(SharedSessionContractImplementor target, TimeZone timezone) { 14 | super(target); 15 | this.timezone = timezone; 16 | } 17 | 18 | @Override 19 | public TimeZone getJdbcTimeZone() { 20 | if (timezone == null) { 21 | return super.getJdbcTimeZone(); 22 | } else { 23 | return timezone; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/concurrent/ProjectorTask.java: -------------------------------------------------------------------------------- 1 | package org.jadira.scanner.core.concurrent; 2 | 3 | import java.util.List; 4 | import java.util.stream.Collectors; 5 | 6 | import org.jadira.scanner.core.api.Projector; 7 | 8 | import jsr166y.RecursiveTask; 9 | 10 | public class ProjectorTask extends RecursiveTask> { 11 | 12 | private static final long serialVersionUID = -5338937563634945167L; 13 | 14 | private final Projector projector; 15 | private final List inputs; 16 | 17 | public ProjectorTask(final Projector projector, final List inputs) { 18 | 19 | this.projector = projector; 20 | this.inputs = inputs; 21 | } 22 | 23 | @Override 24 | public List compute() { 25 | 26 | List result = inputs.stream() 27 | .flatMap( t -> projector.project(t).stream() ) 28 | .collect( Collectors.toList() ); 29 | 30 | return result; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localDateTime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/monthDay.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/moneyandcurrency/moneta/util/CurrencyUnitConfigured.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011, 2012 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.moneyandcurrency.moneta.util; 17 | 18 | import javax.money.CurrencyUnit; 19 | 20 | public interface CurrencyUnitConfigured { 21 | 22 | void setCurrencyUnit(CurrencyUnit currencyUnit); 23 | } 24 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateTime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/yearAsInteger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localTime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/moneyandcurrency/joda/util/CurrencyUnitConfigured.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011, 2012 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.moneyandcurrency.joda.util; 17 | 18 | import org.joda.money.CurrencyUnit; 19 | 20 | public interface CurrencyUnitConfigured { 21 | 22 | void setCurrencyUnit(CurrencyUnit currencyUnit); 23 | } 24 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/unitsofmeasurement/indriya/util/UnitConfigured.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011, 2012 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.unitsofmeasurement.indriya.util; 17 | 18 | import javax.measure.Quantity; 19 | import javax.measure.Unit; 20 | 21 | public interface UnitConfigured> { 22 | 23 | void setUnit(Unit unit); 24 | } 25 | -------------------------------------------------------------------------------- /usertype.core/src/test/java/org/jadira/usertype/country/TestCountrySuite.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.country; 2 | 3 | import javax.persistence.EntityManagerFactory; 4 | import javax.persistence.Persistence; 5 | 6 | import org.junit.AfterClass; 7 | import org.junit.BeforeClass; 8 | import org.junit.runner.RunWith; 9 | import org.junit.runners.Suite; 10 | import org.junit.runners.Suite.SuiteClasses; 11 | 12 | @RunWith(Suite.class) 13 | @SuiteClasses(value = { 14 | TestPersistentISOCountryCode.class 15 | }) 16 | public class TestCountrySuite { 17 | 18 | private static EntityManagerFactory factory; 19 | 20 | @BeforeClass 21 | public static void setup() { 22 | factory = Persistence.createEntityManagerFactory("test1"); 23 | } 24 | 25 | @AfterClass 26 | public static void tearDown() { 27 | factory.close(); 28 | } 29 | 30 | public static EntityManagerFactory getFactory() { 31 | if (factory == null) { 32 | setup(); 33 | } 34 | return factory; 35 | } 36 | } -------------------------------------------------------------------------------- /scanner/src/main/resources/java-Oracle_Corporation-1_7_0_09_lib_ext_sunmscapi_jar.classes: -------------------------------------------------------------------------------- 1 | sun/security/mscapi/Key.class 2 | sun/security/mscapi/KeyStore$1.class 3 | sun/security/mscapi/KeyStore$KeyEntry.class 4 | sun/security/mscapi/KeyStore$MY.class 5 | sun/security/mscapi/KeyStore$ROOT.class 6 | sun/security/mscapi/KeyStore.class 7 | sun/security/mscapi/PRNG.class 8 | sun/security/mscapi/RSACipher.class 9 | sun/security/mscapi/RSAKeyPair.class 10 | sun/security/mscapi/RSAKeyPairGenerator.class 11 | sun/security/mscapi/RSAPrivateKey.class 12 | sun/security/mscapi/RSAPublicKey.class 13 | sun/security/mscapi/RSASignature$MD2.class 14 | sun/security/mscapi/RSASignature$MD5.class 15 | sun/security/mscapi/RSASignature$Raw.class 16 | sun/security/mscapi/RSASignature$SHA1.class 17 | sun/security/mscapi/RSASignature$SHA256.class 18 | sun/security/mscapi/RSASignature$SHA384.class 19 | sun/security/mscapi/RSASignature$SHA512.class 20 | sun/security/mscapi/RSASignature.class 21 | sun/security/mscapi/SunMSCAPI$1.class 22 | sun/security/mscapi/SunMSCAPI.class -------------------------------------------------------------------------------- /usertype.spi/src/main/java/org/jadira/usertype/spi/utils/lang/AssertionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.spi.utils.lang; 17 | 18 | public class AssertionException extends RuntimeException { 19 | 20 | private static final long serialVersionUID = -8588872181858576547L; 21 | 22 | public AssertionException(String string) { 23 | super(string); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /usertype.core/src/test/java/org/jadira/usertype/corejava/enumerated/TestCoreJavaSuite.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.corejava.enumerated; 2 | 3 | import javax.persistence.EntityManagerFactory; 4 | import javax.persistence.Persistence; 5 | 6 | import org.junit.AfterClass; 7 | import org.junit.BeforeClass; 8 | import org.junit.runner.RunWith; 9 | import org.junit.runners.Suite; 10 | import org.junit.runners.Suite.SuiteClasses; 11 | 12 | @RunWith(Suite.class) 13 | @SuiteClasses(value = { 14 | TestPersistentEnum.class 15 | }) 16 | public class TestCoreJavaSuite { 17 | 18 | private static EntityManagerFactory factory; 19 | 20 | @BeforeClass 21 | public static void setup() { 22 | factory = Persistence.createEntityManagerFactory("test1"); 23 | } 24 | 25 | @AfterClass 26 | public static void tearDown() { 27 | factory.close(); 28 | } 29 | 30 | public static EntityManagerFactory getFactory() { 31 | if (factory == null) { 32 | setup(); 33 | } 34 | return factory; 35 | } 36 | } -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localTimeAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/yearMonthAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /usertype.core/src/test/java/org/jadira/usertype/phonenumber/TestPhoneNumberSuite.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.phonenumber; 2 | 3 | import javax.persistence.EntityManagerFactory; 4 | import javax.persistence.Persistence; 5 | 6 | import org.junit.AfterClass; 7 | import org.junit.BeforeClass; 8 | import org.junit.runner.RunWith; 9 | import org.junit.runners.Suite; 10 | import org.junit.runners.Suite.SuiteClasses; 11 | 12 | @RunWith(Suite.class) 13 | @SuiteClasses(value = { 14 | TestPersistentE164PhoneNumberWithExtension.class 15 | }) 16 | public class TestPhoneNumberSuite { 17 | 18 | private static EntityManagerFactory factory; 19 | 20 | @BeforeClass 21 | public static void setup() { 22 | factory = Persistence.createEntityManagerFactory("test1"); 23 | } 24 | 25 | @AfterClass 26 | public static void tearDown() { 27 | factory.close(); 28 | } 29 | 30 | public static EntityManagerFactory getFactory() { 31 | if (factory == null) { 32 | setup(); 33 | } 34 | return factory; 35 | } 36 | } -------------------------------------------------------------------------------- /bindings/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2010 Christopher Pheby 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | # Set root logger level to INFO and its only appender to A1. 17 | log4j.rootLogger=INFO, A1 18 | 19 | # A1 is set to be a ConsoleAppender. 20 | log4j.appender.A1=org.apache.log4j.ConsoleAppender 21 | 22 | # A1 uses PatternLayout. 23 | log4j.appender.A1.layout=org.apache.log4j.PatternLayout 24 | log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/offsetTimeAsTimeAndStringOffset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localTimeAsNanosLong.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localTimeAsMillisInteger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/offsetTimeAsLongAndStringOffset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2010, 2011 Christopher Pheby 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | # Set root logger level to INFO and its only appender to A1. 17 | log4j.rootLogger=INFO, A1 18 | 19 | # A1 is set to be a ConsoleAppender. 20 | log4j.appender.A1=org.apache.log4j.ConsoleAppender 21 | 22 | # A1 uses PatternLayout. 23 | log4j.appender.A1.layout=org.apache.log4j.PatternLayout 24 | log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n -------------------------------------------------------------------------------- /usertype.core/src/test/java/org/jadira/usertype/moneyandcurrency/legacyjdk/TestLegacyJdkMoneySuite.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.moneyandcurrency.legacyjdk; 2 | 3 | import javax.persistence.EntityManagerFactory; 4 | import javax.persistence.Persistence; 5 | 6 | import org.junit.AfterClass; 7 | import org.junit.BeforeClass; 8 | import org.junit.runner.RunWith; 9 | import org.junit.runners.Suite; 10 | import org.junit.runners.Suite.SuiteClasses; 11 | 12 | @RunWith(Suite.class) 13 | @SuiteClasses(value = { 14 | TestPersistentCurrency.class, 15 | }) 16 | public class TestLegacyJdkMoneySuite { 17 | 18 | private static EntityManagerFactory factory; 19 | 20 | @BeforeClass 21 | public static void setup() { 22 | factory = Persistence.createEntityManagerFactory("test1"); 23 | } 24 | 25 | @AfterClass 26 | public static void tearDown() { 27 | factory.close(); 28 | } 29 | 30 | public static EntityManagerFactory getFactory() { 31 | if (factory == null) { 32 | setup(); 33 | } 34 | return factory; 35 | } 36 | } -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/offsetTimeAsStringAndStringOffset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/periodAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /usertype.core/src/test/java/org/jadira/usertype/dateandtime/legacyjdk/TestLegacyJdkSuite.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.dateandtime.legacyjdk; 2 | 3 | import javax.persistence.EntityManagerFactory; 4 | import javax.persistence.Persistence; 5 | 6 | import org.junit.AfterClass; 7 | import org.junit.BeforeClass; 8 | import org.junit.runner.RunWith; 9 | import org.junit.runners.Suite; 10 | import org.junit.runners.Suite.SuiteClasses; 11 | 12 | @RunWith(Suite.class) 13 | @SuiteClasses(value = { 14 | TestPersistentDate.class, 15 | TestPersistentTimestamp.class 16 | }) 17 | public class TestLegacyJdkSuite { 18 | 19 | private static EntityManagerFactory factory; 20 | 21 | @BeforeClass 22 | public static void setup() { 23 | factory = Persistence.createEntityManagerFactory("test1"); 24 | } 25 | 26 | @AfterClass 27 | public static void tearDown() { 28 | factory.close(); 29 | } 30 | 31 | public static EntityManagerFactory getFactory() { 32 | if (factory == null) { 33 | setup(); 34 | } 35 | return factory; 36 | } 37 | } -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/joda/util/ZoneHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.joda.util; 17 | 18 | import org.joda.time.DateTimeZone; 19 | 20 | public final class ZoneHelper { 21 | 22 | private ZoneHelper() { 23 | } 24 | 25 | 26 | public static DateTimeZone getDefault() { 27 | return DateTimeZone.getDefault(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/durationAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/localTimeAsTimestamp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /cloning/src/main/java/org/jadira/reflection/access/api/MethodAccess.java: -------------------------------------------------------------------------------- 1 | package org.jadira.reflection.access.api; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | /** 6 | * Defines a mechanism for accessing a specific method within a specific class 7 | * @param The class containing the method to be accessed 8 | */ 9 | public interface MethodAccess { 10 | 11 | /** 12 | * Get the Class containing the field being accessed 13 | * @return The class 14 | */ 15 | public Class declaringClass(); 16 | 17 | /** 18 | * The Class giving the type of the method result or null 19 | * @return The result class 20 | */ 21 | public Class returnClass(); 22 | 23 | /** 24 | * Get the Method being accessed 25 | * @return The method 26 | */ 27 | public Method method(); 28 | 29 | /** 30 | * Invokes the method 31 | * @param parent The instance to access the method for 32 | * @param args The arguments to supply when invoking the method 33 | * @return The result of the method invocation, or null for a void method 34 | */ 35 | Object invoke(C parent, Object ... args); 36 | } 37 | -------------------------------------------------------------------------------- /bindings/src/test/resources/another-bindings.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/site/fml/faqs.fml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | What is the Date and Time offsetting problem? 11 | Details are available at the Jadira Blog 12 | 13 | 14 | 15 | My date and time are being offset incorrectly on MySQL 16 | First ensure you are using MySQL driver version 5.1.5 or later. Set the connection property 'useLegacyDatetimeCode=false'. For example, ''. 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/classpath/filter/JElementTypeFilter.java: -------------------------------------------------------------------------------- 1 | package org.jadira.scanner.classpath.filter; 2 | 3 | import java.util.Collection; 4 | import java.util.HashSet; 5 | import java.util.Set; 6 | 7 | import org.jadira.scanner.classpath.types.JElement; 8 | import org.jadira.scanner.core.filter.AbstractFilter; 9 | 10 | public class JElementTypeFilter extends AbstractFilter { 11 | 12 | private Set> elementTypes = new HashSet>(); 13 | 14 | public JElementTypeFilter() { 15 | } 16 | 17 | public JElementTypeFilter(Class type) { 18 | if (type != null) { 19 | elementTypes.add(type); 20 | } 21 | } 22 | 23 | public JElementTypeFilter(Collection> types) { 24 | for (Class next : types) { 25 | elementTypes.add(next); 26 | } 27 | } 28 | 29 | @Override 30 | public boolean accept(JElement element) { 31 | 32 | final boolean shouldAccept = elementTypes.contains(element.getClass()); 33 | return shouldAccept; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/dateTimeAndZoneWithOffset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/zonedOffsetAsString.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /usertype.core/src/test/java/org/jadira/usertype/unitsofmeaurement/indriya/TestIndriyaSuite.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.unitsofmeaurement.indriya; 2 | 3 | import javax.persistence.EntityManagerFactory; 4 | import javax.persistence.Persistence; 5 | 6 | import org.junit.AfterClass; 7 | import org.junit.BeforeClass; 8 | import org.junit.runner.RunWith; 9 | import org.junit.runners.Suite; 10 | import org.junit.runners.Suite.SuiteClasses; 11 | 12 | @RunWith(Suite.class) 13 | @SuiteClasses(value = { 14 | TestPersistentQuantity.class, 15 | TestPersistentQuantityAndUnit.class, 16 | TestPersistentUnit.class 17 | }) 18 | public class TestIndriyaSuite { 19 | 20 | private static EntityManagerFactory factory; 21 | 22 | @BeforeClass 23 | public static void setup() { 24 | factory = Persistence.createEntityManagerFactory("test1"); 25 | } 26 | 27 | @AfterClass 28 | public static void tearDown() { 29 | factory.close(); 30 | } 31 | 32 | public static EntityManagerFactory getFactory() { 33 | if (factory == null) { 34 | setup(); 35 | } 36 | return factory; 37 | } 38 | } -------------------------------------------------------------------------------- /bindings/src/test/java/org/jadira/bindings/core/test/SubjectB.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.test; 17 | 18 | public class SubjectB { 19 | 20 | public static String marshalMethodC(SubjectA subject) { 21 | 22 | return subject.getValue() + ":MARSHALLED_BY_C"; 23 | } 24 | 25 | public static SubjectA unmarshalMethodB(String string) { 26 | return new SubjectA(string.substring(0, string.lastIndexOf(':'))); 27 | } 28 | } -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/helper/filenamefilter/JarFilenameFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.scanner.core.helper.filenamefilter; 17 | 18 | import java.io.FilenameFilter; 19 | 20 | public class JarFilenameFilter implements FilenameFilter { 21 | 22 | public boolean accept(java.io.File dir, String filename) { 23 | 24 | if (filename.endsWith(".jar")) { 25 | return true; 26 | } 27 | return false; 28 | } 29 | } -------------------------------------------------------------------------------- /bindings/src/main/java/org/jadira/bindings/core/api/Binding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Sousan Rassoul 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.api; 17 | 18 | 19 | /** 20 | * Interface defining bindings between two particular class. 21 | *

22 | * Implementations must be idempotent between calls and are expected to be thread-safe. 23 | * @param Source type for the conversion 24 | * @param Target type 25 | */ 26 | public interface Binding extends ToMarshaller, FromUnmarshaller { 27 | } 28 | -------------------------------------------------------------------------------- /cloning/src/main/java/org/jadira/reflection/core/identity/Tuple.java: -------------------------------------------------------------------------------- 1 | package org.jadira.reflection.core.identity; 2 | 3 | import java.util.Objects; 4 | 5 | public final class Tuple { 6 | 7 | // TODO Add toString and Comparable 8 | 9 | public final L left; 10 | public final R right; 11 | 12 | public static Tuple of(L left, R right) { 13 | return new Tuple(left, right); 14 | } 15 | 16 | public Tuple(L left, R right) { 17 | this.left = left; 18 | this.right = right; 19 | } 20 | 21 | public L getLeft() { 22 | return left; 23 | } 24 | 25 | public R getRight() { 26 | return right; 27 | } 28 | 29 | @Override 30 | public boolean equals(Object obj) { 31 | if (obj == this) { 32 | return true; 33 | } 34 | if (obj instanceof Tuple) { 35 | Tuple other = (Tuple) obj; 36 | return Objects.equals(getLeft(), other.getLeft()) 37 | && Objects.equals(getRight(), other.getRight()); 38 | } 39 | return false; 40 | } 41 | 42 | @Override 43 | public int hashCode() { 44 | return (getLeft() == null ? 0 : getLeft().hashCode()) 45 | ^ (getRight() == null ? 0 : getRight().hashCode()); 46 | } 47 | } -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/zonedDateTimeAsStringStringOffsetAndStringZone.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /bindings/src/test/resources/META-INF/bindings.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /usertype.core/src/test/java/org/jadira/usertype/dateandtime/threeten/columnmapper/BigIntegerColumnInstantMapperTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten.columnmapper; 17 | 18 | import static org.junit.Assert.assertEquals; 19 | 20 | import java.time.Instant; 21 | 22 | import org.junit.Test; 23 | 24 | public class BigIntegerColumnInstantMapperTest { 25 | 26 | @Test 27 | public void testReturnedClass() { 28 | assertEquals(Instant.class, new BigIntegerColumnInstantMapper().returnedClass()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /bindings/src/main/java/org/jadira/bindings/core/provider/StandardConverterProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.provider; 17 | 18 | import org.jadira.bindings.core.annotation.From; 19 | import org.jadira.bindings.core.annotation.To; 20 | import org.jadira.bindings.core.spi.ConverterProvider; 21 | 22 | /** 23 | * Built in provider for the bindings framework annotations 24 | */ 25 | public class StandardConverterProvider extends AbstractAnnotationMatchingConverterProvider implements ConverterProvider { 26 | } 27 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/classpath/api/JClassFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.scanner.classpath.api; 17 | 18 | import org.jadira.scanner.classpath.types.JClass; 19 | import org.jadira.scanner.classpath.types.JElement; 20 | import org.jadira.scanner.core.filter.AbstractFilter; 21 | 22 | public class JClassFilter extends AbstractFilter implements JElementFilter { 23 | 24 | public JClassFilter() { 25 | } 26 | 27 | @Override 28 | public boolean accept(JElement element) { 29 | return JClass.class.isAssignableFrom(element.getClass()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/api/Resolver.java: -------------------------------------------------------------------------------- 1 | package org.jadira.scanner.core.api; 2 | 3 | import java.util.List; 4 | 5 | public interface Resolver { 6 | 7 | /** 8 | * Resolve the first match 9 | * @param locator Locator to be used 10 | * @param projector Projector to be used 11 | * @param filter Zero or more filters to be used 12 | * @return The first match 13 | */ 14 | T resolveFirst(Locator locator, Projector projector, Filter... filter); 15 | 16 | /** 17 | * Resolve all matches up to limit 18 | * @param limit The maximum number of results to match 19 | * @param locator Locator to be used 20 | * @param projector Projector to be used 21 | * @param filter Zero or more filters to be used 22 | * @return The first match 23 | */ 24 | List resolve(Integer limit, Locator locator, Projector projector, Filter... filter); 25 | 26 | /** 27 | * Resolve all matches 28 | * @param locator Locator to be used 29 | * @param projector Projector to be used 30 | * @param filter Zero or more filters to be used 31 | * @return The first match 32 | */ 33 | List resolveAll(Locator locator, Projector projector, Filter... filter); 34 | } 35 | -------------------------------------------------------------------------------- /cloning/src/main/java/org/jadira/reflection/cloning/api/CloneStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.reflection.cloning.api; 17 | 18 | /** 19 | * A specific kind of {@link CloneImplementor} that is intended for plugging into a {@link Cloner}. 20 | * CloneStrategies must be capable of working with all available classes, whereas standard 21 | * {@link CloneImplementor}s are typically written for cloning a specific class type. 22 | */ 23 | public interface CloneStrategy extends CloneImplementor { 24 | 25 | /** 26 | * @param classes Classes to initialise for 27 | */ 28 | void initialiseFor(Class... classes); 29 | } 30 | -------------------------------------------------------------------------------- /usertype.spi/src/main/java/org/jadira/usertype/spi/shared/ColumnMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.spi.shared; 17 | 18 | import org.hibernate.type.SingleColumnType; 19 | 20 | public interface ColumnMapper { 21 | 22 | SingleColumnType getHibernateType(); 23 | 24 | int getSqlType(); 25 | 26 | T fromNonNullValue(J value); 27 | 28 | T fromNonNullString(String s); 29 | 30 | J toNonNullValue(T value); 31 | 32 | String toNonNullString(T value); 33 | 34 | Class returnedClass(); 35 | 36 | Class jdbcClass(); 37 | } 38 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/core/api/Filter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.scanner.core.api; 17 | 18 | /** 19 | * Instances of classes that implement this interface are used to filter resolution. 20 | */ 21 | public interface Filter { 22 | 23 | Class targetType(); 24 | 25 | /** 26 | * Tests if a specified item should be included. 27 | * @param filterParameter the item to filter on 28 | * @return true if and only if the item should be included in the list; false otherwise. 29 | */ 30 | boolean accept(T filterParameter); 31 | } -------------------------------------------------------------------------------- /usertype.spi/src/main/java/org/jadira/usertype/spi/shared/AbstractVersionableTimestampColumnMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.spi.shared; 17 | 18 | import java.sql.Timestamp; 19 | 20 | public abstract class AbstractVersionableTimestampColumnMapper extends AbstractTimestampColumnMapper implements VersionableColumnMapper { 21 | 22 | private static final long serialVersionUID = -1406891387234804017L; 23 | 24 | @Override 25 | public Timestamp generateCurrentValue() { 26 | return new Timestamp(System.currentTimeMillis()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/file/locator/IdentityUrlLocator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.scanner.file.locator; 17 | 18 | import java.net.URL; 19 | import java.util.List; 20 | 21 | import org.jadira.scanner.core.api.Locator; 22 | 23 | /** 24 | * A Locator that returns an explicit set of classpaths 25 | */ 26 | public class IdentityUrlLocator implements Locator { 27 | 28 | private List urls; 29 | 30 | public IdentityUrlLocator(List urls) { 31 | this.urls = urls; 32 | } 33 | 34 | @Override 35 | public List locate() { 36 | return urls; 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentMonthAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.Month; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.StringColumnMonthMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Persist {@link Month} via Hibernate. 25 | */ 26 | public class PersistentMonthAsString extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 5686457807800307458L; 29 | } 30 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentYearAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.Year; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.StringColumnYearMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Maps a {@link Year} to and from String for Hibernate. 25 | */ 26 | public class PersistentYearAsString extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 2203287045641899191L; 29 | } 30 | -------------------------------------------------------------------------------- /bindings/src/main/java/org/jadira/bindings/core/jdk/ByteStringBinding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.jdk; 17 | 18 | import org.jadira.bindings.core.api.Binding; 19 | 20 | /** 21 | * Binds a Byte to a String 22 | */ 23 | public class ByteStringBinding extends AbstractStringBinding implements Binding { 24 | 25 | /** 26 | * {@inheritDoc} 27 | */ 28 | @Override 29 | public Byte unmarshal(String object) { 30 | return Byte.valueOf(Byte.parseByte(object)); 31 | } 32 | 33 | public Class getBoundClass() { 34 | return Byte.class; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /bindings/src/main/resources/META-INF/bindings.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentInstantAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.Instant; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.StringColumnInstantMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Persist {@link Instant} via Hibernate. 25 | */ 26 | public class PersistentInstantAsString extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = -7212497504048340155L; 29 | } 30 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentYearAsInteger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.Year; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.IntegerColumnYearMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Persist {@link Year} via Hibernate using integer value. 25 | */ 26 | public class PersistentYearAsInteger extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 4694981953643179773L; 29 | } 30 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/joda/PersistentYears.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.joda; 17 | 18 | import org.jadira.usertype.dateandtime.joda.columnmapper.IntegerColumnYearsMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.time.Years; 21 | 22 | /** 23 | * Persist {@link Years} via Hibernate using integer value. 24 | */ 25 | public class PersistentYears extends AbstractSingleColumnUserType { 26 | 27 | private static final long serialVersionUID = 6344511081714826983L; 28 | } 29 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentMonthDayAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.MonthDay; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.StringColumnMonthDayMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Persist {@link MonthDay} via Hibernate. 25 | */ 26 | public class PersistentMonthDayAsString extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 5686457807800307458L; 29 | } 30 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/joda/PersistentInstantAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.joda; 17 | 18 | import org.jadira.usertype.dateandtime.joda.columnmapper.StringColumnInstantMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.time.Instant; 21 | 22 | /** 23 | * Persist {@link Instant} via Hibernate. 24 | */ 25 | public class PersistentInstantAsString extends AbstractSingleColumnUserType { 26 | 27 | private static final long serialVersionUID = 899460930052042931L; 28 | } 29 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentDayOfWeekAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.DayOfWeek; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.StringColumnDayOfWeekMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Persist {@link DayOfWeek} via Hibernate. 25 | */ 26 | public class PersistentDayOfWeekAsString extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 5686457807800307458L; 29 | } 30 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentMonthAsInteger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.Month; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.IntegerColumnMonthMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Persist {@link Month} via Hibernate using integer value. 25 | */ 26 | public class PersistentMonthAsInteger extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 4694981953643179773L; 29 | } 30 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentZoneIdAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.ZoneId; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.StringColumnZoneIdMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Maps a {@link ZoneId} to and from String for Hibernate. 25 | */ 26 | public class PersistentZoneIdAsString extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = -4510322446163655815L; 29 | } 30 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/classpath/filter/NameFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.scanner.classpath.filter; 17 | 18 | import org.jadira.scanner.classpath.api.JElementFilter; 19 | import org.jadira.scanner.classpath.types.JElement; 20 | import org.jadira.scanner.core.filter.AbstractFilter; 21 | 22 | public class NameFilter extends AbstractFilter implements JElementFilter { 23 | 24 | private String name; 25 | 26 | public NameFilter(String name) { 27 | this.name = name; 28 | } 29 | 30 | @Override 31 | public boolean accept(JElement element) { 32 | return name.equals(element.getName()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/joda/PersistentMinutes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.joda; 17 | 18 | import org.jadira.usertype.dateandtime.joda.columnmapper.IntegerColumnMinutesMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.time.Minutes; 21 | 22 | /** 23 | * Persist {@link Minutes} via Hibernate using integer value. 24 | */ 25 | public class PersistentMinutes extends AbstractSingleColumnUserType { 26 | 27 | private static final long serialVersionUID = 6344511081714826983L; 28 | } 29 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/joda/PersistentMonthDayAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.joda; 17 | 18 | import org.jadira.usertype.dateandtime.joda.columnmapper.StringColumnMonthDayMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.time.MonthDay; 21 | 22 | /** 23 | * Persist {@link MonthDay} via Hibernate. 24 | */ 25 | public class PersistentMonthDayAsString extends AbstractSingleColumnUserType { 26 | 27 | private static final long serialVersionUID = 5686457807800307458L; 28 | } 29 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentLocalDateAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.LocalDate; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.StringColumnLocalDateMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Persist {@link LocalDate} as a String via Hibernate. 25 | */ 26 | public class PersistentLocalDateAsString extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 6668184655176493317L; 29 | } 30 | -------------------------------------------------------------------------------- /scanner/src/main/java/org/jadira/scanner/classfile/filter/NameFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.scanner.classfile.filter; 17 | 18 | import javassist.bytecode.ClassFile; 19 | 20 | import org.jadira.scanner.core.api.Filter; 21 | import org.jadira.scanner.core.filter.AbstractFilter; 22 | 23 | public class NameFilter extends AbstractFilter implements Filter { 24 | 25 | private String name; 26 | 27 | public NameFilter(String name) { 28 | this.name = name; 29 | } 30 | 31 | @Override 32 | public boolean accept(ClassFile element) { 33 | boolean accept = name.equals(element.getName()); 34 | return accept; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentYearMonthAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.YearMonth; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.StringColumnYearMonthMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Maps a {@link YearMonth} to and from String for Hibernate. 25 | */ 26 | public class PersistentYearMonthAsString extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 2203287045641899191L; 29 | } 30 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/moneyandcurrency/legacyjdk/PersistentCurrency.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011, 2012 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.moneyandcurrency.legacyjdk; 17 | 18 | import java.util.Currency; 19 | 20 | import org.jadira.usertype.moneyandcurrency.legacyjdk.columnmapper.StringColumnCurrencyMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Maps a {@link Currency} to and from String for Hibernate. 25 | */ 26 | public class PersistentCurrency extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = -2015829087239519037L; 29 | } 30 | -------------------------------------------------------------------------------- /src/site/xdoc/licensecover.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 23 | Usertype - Licensing 24 | Chris Pheby 25 | 26 | 27 | 28 | 29 |

30 |

31 | Usertype is released under the business-friendly Apache 2.0 license. 32 |

33 |
34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentDayOfWeekAsInteger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.DayOfWeek; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.IntegerColumnDayOfWeekMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Persist {@link DayOfWeek} via Hibernate using integer value. 25 | */ 26 | public class PersistentDayOfWeekAsInteger extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 4694981953643179773L; 29 | } 30 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentZoneOffsetAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.ZoneOffset; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.StringColumnZoneOffsetMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Maps a {@link ZoneOffset} to and from String for Hibernate. 25 | */ 26 | public class PersistentZoneOffsetAsString extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 6025957718355515493L; 29 | } 30 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/joda/PersistentLocalDateAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.joda; 17 | 18 | import org.jadira.usertype.dateandtime.joda.columnmapper.StringColumnLocalDateMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.time.LocalDate; 21 | 22 | /** 23 | * Persist {@link LocalDate} as a String via Hibernate. 24 | */ 25 | public class PersistentLocalDateAsString extends AbstractSingleColumnUserType { 26 | 27 | private static final long serialVersionUID = -1039569606757252201L; 28 | } 29 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentLocalDateTimeAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.LocalDateTime; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.StringColumnLocalDateTimeMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Persist {@link LocalDateTime} via Hibernate. 25 | */ 26 | public class PersistentLocalDateTimeAsString extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 4865444142792602978L; 29 | } 30 | -------------------------------------------------------------------------------- /cloning/src/main/java/org/jadira/reflection/cloning/annotation/Immutable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.reflection.cloning.annotation; 17 | 18 | import static java.lang.annotation.ElementType.TYPE; 19 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 20 | 21 | import java.lang.annotation.Documented; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.Target; 24 | 25 | /** 26 | * This annotation is intended as a hint that the annotated class is immutable or effectively immutable. 27 | * Alternatively javax.annotation.concurrent.Immutable may be used 28 | */ 29 | @Retention(RUNTIME) 30 | @Target({ TYPE }) 31 | @Documented 32 | public @interface Immutable { 33 | } 34 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/joda/PersistentYearMonthAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.joda; 17 | 18 | import org.jadira.usertype.dateandtime.joda.columnmapper.StringColumnYearMonthMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.time.YearMonth; 21 | 22 | /** 23 | * Maps a {@link YearMonth} to and from String for Hibernate. 24 | */ 25 | public class PersistentYearMonthAsString extends AbstractSingleColumnUserType { 26 | 27 | private static final long serialVersionUID = 2203287045641899191L; 28 | } 29 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/unitsofmeasurement/indriya/columnmapper/StringColumnStringMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011, 2012 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.unitsofmeasurement.indriya.columnmapper; 17 | 18 | import org.jadira.usertype.spi.shared.AbstractStringColumnMapper; 19 | 20 | public class StringColumnStringMapper extends AbstractStringColumnMapper { 21 | 22 | private static final long serialVersionUID = 4205713919952452881L; 23 | 24 | @Override 25 | public String fromNonNullValue(String val) { 26 | 27 | return val; 28 | } 29 | 30 | @Override 31 | public String toNonNullValue(String value) { 32 | return value; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /usertype.core/src/test/java/org/jadira/usertype/moneyandcurrency/moneta/TestMonetaMoneySuite.java: -------------------------------------------------------------------------------- 1 | package org.jadira.usertype.moneyandcurrency.moneta; 2 | 3 | import javax.persistence.EntityManagerFactory; 4 | import javax.persistence.Persistence; 5 | 6 | import org.junit.AfterClass; 7 | import org.junit.BeforeClass; 8 | import org.junit.runner.RunWith; 9 | import org.junit.runners.Suite; 10 | import org.junit.runners.Suite.SuiteClasses; 11 | 12 | @RunWith(Suite.class) 13 | @SuiteClasses(value = { TestPersistentCurrencyUnit.class, TestPersistentMoneyAmount.class, 14 | TestPersistentMoneyAmountAndCurrency.class, TestPersistentMoneyMajorAmount.class, 15 | TestPersistentMoneyMajorAmountAndCurrency.class, TestPersistentMoneyMinorAmount.class, 16 | TestPersistentMoneyMinorAmountAndCurrency.class }) 17 | public class TestMonetaMoneySuite { 18 | 19 | private static EntityManagerFactory factory; 20 | 21 | @BeforeClass 22 | public static void setup() { 23 | factory = Persistence.createEntityManagerFactory("test1"); 24 | } 25 | 26 | @AfterClass 27 | public static void tearDown() { 28 | factory.close(); 29 | } 30 | 31 | public static EntityManagerFactory getFactory() { 32 | if (factory == null) { 33 | setup(); 34 | } 35 | return factory; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/moneyandcurrency/moneta/PersistentCurrencyUnit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011, 2012 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.moneyandcurrency.moneta; 17 | 18 | import javax.money.CurrencyUnit; 19 | 20 | import org.jadira.usertype.moneyandcurrency.moneta.columnmapper.StringColumnCurrencyUnitMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Maps a {@link CurrencyUnit} to and from String for Hibernate. 25 | */ 26 | public class PersistentCurrencyUnit extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 5653012946771904484L; 29 | } 30 | -------------------------------------------------------------------------------- /quant/src/main/java/org/jadira/quant/api/QuantitativeFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.quant.api; 17 | 18 | /** 19 | * This interface defines a function. It is intended to be adaptable to /compatible with 20 | * {@code java.util.function.Function} being introduced into Java 8. 21 | * @param The input type of the function. 22 | * @param The result type of the function. 23 | */ 24 | //@FunctionalInterface for Java 8 25 | public interface QuantitativeFunction { 26 | 27 | /** 28 | * Apply a function to the input argument T, yielding an appropriate result R. 29 | * @param value the input value 30 | * @return the result of the function 31 | */ 32 | R apply(T value); 33 | } -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/joda/PersistentLocalDateTimeAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.joda; 17 | 18 | import org.jadira.usertype.dateandtime.joda.columnmapper.StringColumnLocalDateTimeMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.time.LocalDateTime; 21 | 22 | /** 23 | * Persist {@link LocalDateTime} via Hibernate. 24 | */ 25 | public class PersistentLocalDateTimeAsString extends AbstractSingleColumnUserType { 26 | 27 | private static final long serialVersionUID = 6089350124392309729L; 28 | } 29 | -------------------------------------------------------------------------------- /usertype.spi/src/test/java/org/jadira/usertype/dateandtime/shared/dbunit/RuntimeDatabaseUnitException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.shared.dbunit; 17 | 18 | import java.io.IOException; 19 | 20 | import org.dbunit.DatabaseUnitException; 21 | 22 | public class RuntimeDatabaseUnitException extends RuntimeException { 23 | 24 | private static final long serialVersionUID = -7283266706065074477L; 25 | 26 | public RuntimeDatabaseUnitException(DatabaseUnitException e) { 27 | super(e.getMessage(), e); 28 | } 29 | 30 | public RuntimeDatabaseUnitException(IOException e) { 31 | super(e.getMessage(), e); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /bindings/src/test/java/org/jadira/bindings/core/jdk/StringStringBindingTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.jdk; 17 | 18 | import static org.junit.Assert.assertEquals; 19 | 20 | import org.junit.Test; 21 | 22 | public class StringStringBindingTest { 23 | 24 | private static final CharSequenceStringBinding BINDING = new CharSequenceStringBinding(); 25 | 26 | @Test 27 | public void testUnmarshal() { 28 | 29 | assertEquals("Hello World", BINDING.unmarshal("Hello World")); 30 | } 31 | 32 | @Test 33 | public void testMarshal() { 34 | 35 | assertEquals("Hello World", BINDING.marshal("Hello World")); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /bindings/src/main/java/org/jadira/bindings/core/jdk/StringStringBinding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.jdk; 17 | 18 | import org.jadira.bindings.core.api.Binding; 19 | 20 | /** 21 | * Binds a String to a String 22 | */ 23 | public class StringStringBinding extends AbstractStringBinding implements Binding { 24 | 25 | /** 26 | * {@inheritDoc} 27 | */ 28 | @Override 29 | public String unmarshal(String object) { 30 | return object; 31 | } 32 | 33 | /** 34 | * {@inheritDoc} 35 | */ 36 | /* @Override */ 37 | public Class getBoundClass() { 38 | return String.class; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/joda/PersistentDateTimeZoneAsString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.joda; 17 | 18 | import org.jadira.usertype.dateandtime.joda.columnmapper.StringColumnDateTimeZoneMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.time.DateTimeZone; 21 | 22 | /** 23 | * Maps a {@link DateTimeZone} to and from String for Hibernate. 24 | */ 25 | public class PersistentDateTimeZoneAsString extends AbstractSingleColumnUserType { 26 | 27 | private static final long serialVersionUID = -8759152453256338787L; 28 | } 29 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/moneyandcurrency/joda/PersistentCurrencyUnit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011, 2012 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.moneyandcurrency.joda; 17 | 18 | import org.jadira.usertype.moneyandcurrency.joda.columnmapper.StringColumnCurrencyUnitMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.money.CurrencyUnit; 21 | 22 | /** 23 | * Maps a {@link CurrencyUnit} to and from String for Hibernate. 24 | */ 25 | public class PersistentCurrencyUnit extends AbstractSingleColumnUserType { 26 | 27 | private static final long serialVersionUID = 5653012946771904484L; 28 | } 29 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/joda/PersistentDurationAsMillisLong.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.joda; 17 | 18 | import org.jadira.usertype.dateandtime.joda.columnmapper.LongColumnDurationMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.time.Duration; 21 | 22 | /** 23 | * Maps a {@link Duration} to and from Long for Hibernate. This type stores Duration using 24 | * a millisecond value. 25 | */ 26 | public class PersistentDurationAsMillisLong extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = 5223443949599090296L; 29 | 30 | } -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/columnmapper/StringColumnZoneIdMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten.columnmapper; 17 | 18 | import java.time.ZoneId; 19 | 20 | import org.jadira.usertype.spi.shared.AbstractStringColumnMapper; 21 | 22 | public class StringColumnZoneIdMapper extends AbstractStringColumnMapper { 23 | 24 | private static final long serialVersionUID = 4205713919952452881L; 25 | 26 | @Override 27 | public ZoneId fromNonNullValue(String s) { 28 | return ZoneId.of(s); 29 | } 30 | 31 | @Override 32 | public String toNonNullValue(ZoneId value) { 33 | return value.toString(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /usertype.core/src/test/resources/expected/periodAsString2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /bindings/src/test/java/org/jadira/bindings/core/jdk/CharSequenceStringBindingTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.jdk; 17 | 18 | import static org.junit.Assert.assertEquals; 19 | 20 | import org.junit.Test; 21 | 22 | public class CharSequenceStringBindingTest { 23 | 24 | private static final CharSequenceStringBinding BINDING = new CharSequenceStringBinding(); 25 | 26 | @Test 27 | public void testUnmarshal() { 28 | 29 | assertEquals("Hello World", BINDING.unmarshal("Hello World")); 30 | } 31 | 32 | @Test 33 | public void testMarshal() { 34 | 35 | assertEquals("Hello World", BINDING.marshal("Hello World")); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /bindings/src/main/java/org/jadira/bindings/core/jdk/LongStringBinding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.jdk; 17 | 18 | import org.jadira.bindings.core.api.Binding; 19 | 20 | /** 21 | * Binds a Long to a String 22 | */ 23 | public class LongStringBinding extends AbstractStringBinding implements Binding { 24 | 25 | /** 26 | * {@inheritDoc} 27 | */ 28 | @Override 29 | public Long unmarshal(String object) { 30 | return Long.valueOf(Long.parseLong(object)); 31 | } 32 | 33 | /** 34 | * {@inheritDoc} 35 | */ 36 | /* @Override */ 37 | public Class getBoundClass() { 38 | return Long.class; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/joda/PersistentDurationAsNanosBigInteger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.joda; 17 | 18 | import org.jadira.usertype.dateandtime.joda.columnmapper.LongColumnDurationMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.time.Duration; 21 | 22 | /** 23 | * Maps a {@link Duration} to and from BigInteger for Hibernate. This type stores Duration using 24 | * a nanosecond value. 25 | */ 26 | public class PersistentDurationAsNanosBigInteger extends AbstractSingleColumnUserType { 27 | 28 | private static final long serialVersionUID = -2339112412473925328L; 29 | } -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/PersistentDurationAsMillisLong.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten; 17 | 18 | import java.time.Duration; 19 | 20 | import org.jadira.usertype.dateandtime.threeten.columnmapper.LongColumnDurationMapper; 21 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 22 | 23 | /** 24 | * Maps a {@link Duration} to and from Long for Hibernate. This type stores Duration using 25 | * a millisecond value. 26 | */ 27 | public class PersistentDurationAsMillisLong extends AbstractSingleColumnUserType { 28 | 29 | private static final long serialVersionUID = 5223443949599090296L; 30 | 31 | } -------------------------------------------------------------------------------- /bindings/src/main/java/org/jadira/bindings/core/jdk/BooleanStringBinding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.jdk; 17 | 18 | import org.jadira.bindings.core.api.Binding; 19 | 20 | /** 21 | * Binds a Boolean to a String 22 | */ 23 | public class BooleanStringBinding extends AbstractStringBinding implements Binding { 24 | 25 | /** 26 | * {@inheritDoc} 27 | */ 28 | @Override 29 | public Boolean unmarshal(String object) { 30 | return Boolean.valueOf(object); 31 | } 32 | 33 | /** 34 | * {@inheritDoc} 35 | */ 36 | /* @Override */ 37 | public Class getBoundClass() { 38 | return Boolean.class; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /bindings/src/main/java/org/jadira/bindings/core/jdk/FloatStringBinding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.jdk; 17 | 18 | import org.jadira.bindings.core.api.Binding; 19 | 20 | /** 21 | * Binds a Float to a String 22 | */ 23 | public class FloatStringBinding extends AbstractStringBinding implements Binding { 24 | 25 | /** 26 | * {@inheritDoc} 27 | */ 28 | @Override 29 | public Float unmarshal(String object) { 30 | return Float.valueOf(Float.parseFloat(object)); 31 | } 32 | 33 | /** 34 | * {@inheritDoc} 35 | */ 36 | /* @Override */ 37 | public Class getBoundClass() { 38 | return Float.class; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /bindings/src/main/java/org/jadira/bindings/core/jdk/ShortStringBinding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.jdk; 17 | 18 | import org.jadira.bindings.core.api.Binding; 19 | 20 | /** 21 | * Binds a Short to a String 22 | */ 23 | public class ShortStringBinding extends AbstractStringBinding implements Binding { 24 | 25 | /** 26 | * {@inheritDoc} 27 | */ 28 | @Override 29 | public Short unmarshal(String object) { 30 | return Short.valueOf(Short.parseShort(object)); 31 | } 32 | 33 | /** 34 | * {@inheritDoc} 35 | */ 36 | /* @Override */ 37 | public Class getBoundClass() { 38 | return Short.class; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/columnmapper/StringColumnDurationMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten.columnmapper; 17 | 18 | import java.time.Duration; 19 | 20 | import org.jadira.usertype.spi.shared.AbstractStringColumnMapper; 21 | 22 | public class StringColumnDurationMapper extends AbstractStringColumnMapper { 23 | 24 | private static final long serialVersionUID = -5741261927204773374L; 25 | 26 | @Override 27 | public Duration fromNonNullValue(String s) { 28 | return Duration.parse(s); 29 | } 30 | 31 | @Override 32 | public String toNonNullValue(Duration value) { 33 | return value.toString(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/dateandtime/threeten/columnmapper/StringColumnMonthDayMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.dateandtime.threeten.columnmapper; 17 | 18 | import java.time.MonthDay; 19 | 20 | import org.jadira.usertype.spi.shared.AbstractStringColumnMapper; 21 | 22 | public class StringColumnMonthDayMapper extends AbstractStringColumnMapper { 23 | 24 | private static final long serialVersionUID = 982411452349850753L; 25 | 26 | @Override 27 | public MonthDay fromNonNullValue(String s) { 28 | return MonthDay.parse(s); 29 | } 30 | 31 | @Override 32 | public String toNonNullValue(MonthDay value) { 33 | return value.toString(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /usertype.core/src/main/java/org/jadira/usertype/moneyandcurrency/joda/PersistentCurrencyUnitAsInteger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011, 2012 Christopher Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.usertype.moneyandcurrency.joda; 17 | 18 | import org.jadira.usertype.moneyandcurrency.joda.columnmapper.IntegerColumnCurrencyUnitMapper; 19 | import org.jadira.usertype.spi.shared.AbstractSingleColumnUserType; 20 | import org.joda.money.CurrencyUnit; 21 | 22 | /** 23 | * Maps a {@link CurrencyUnit} to and from an Integer for Hibernate. 24 | */ 25 | public class PersistentCurrencyUnitAsInteger extends AbstractSingleColumnUserType { 26 | 27 | private static final long serialVersionUID = 39712131217254970L; 28 | } 29 | -------------------------------------------------------------------------------- /bindings/src/main/java/org/jadira/bindings/core/jdk/URIStringBinding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, 2011 Chris Pheby 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jadira.bindings.core.jdk; 17 | 18 | import java.net.URI; 19 | 20 | import org.jadira.bindings.core.api.Binding; 21 | 22 | /** 23 | * Binds a URI to a String 24 | */ 25 | public class URIStringBinding extends AbstractStringBinding implements Binding { 26 | 27 | /** 28 | * {@inheritDoc} 29 | */ 30 | @Override 31 | public URI unmarshal(String object) { 32 | 33 | return URI.create(object); 34 | } 35 | 36 | /** 37 | * {@inheritDoc} 38 | */ 39 | /* @Override */ 40 | public Class getBoundClass() { 41 | return URI.class; 42 | } 43 | } 44 | --------------------------------------------------------------------------------