├── .gitignore ├── EclipseFormatter.xml ├── LICENSE.md ├── README.md ├── README_ENG.md ├── arch.png ├── command.bat ├── core ├── pom.xml └── src │ ├── main │ └── java │ │ ├── com │ │ └── github │ │ │ └── drinkjava2 │ │ │ ├── asm │ │ │ ├── AnnotationVisitor.java │ │ │ ├── AnnotationWriter.java │ │ │ ├── Attribute.java │ │ │ ├── ByteVector.java │ │ │ ├── ClassReader.java │ │ │ ├── ClassTooLargeException.java │ │ │ ├── ClassVisitor.java │ │ │ ├── ClassWriter.java │ │ │ ├── ConstantDynamic.java │ │ │ ├── Constants.java │ │ │ ├── Context.java │ │ │ ├── CurrentFrame.java │ │ │ ├── Edge.java │ │ │ ├── FieldVisitor.java │ │ │ ├── FieldWriter.java │ │ │ ├── Frame.java │ │ │ ├── Handle.java │ │ │ ├── Handler.java │ │ │ ├── Label.java │ │ │ ├── MethodTooLargeException.java │ │ │ ├── MethodVisitor.java │ │ │ ├── MethodWriter.java │ │ │ ├── ModuleVisitor.java │ │ │ ├── ModuleWriter.java │ │ │ ├── Opcodes.java │ │ │ ├── Symbol.java │ │ │ ├── SymbolTable.java │ │ │ ├── Type.java │ │ │ ├── TypePath.java │ │ │ ├── TypeReference.java │ │ │ └── package-info.java │ │ │ ├── cglib │ │ │ ├── Readme.java │ │ │ ├── beans │ │ │ │ ├── BeanCopier.java │ │ │ │ ├── BeanGenerator.java │ │ │ │ ├── BeanMap.java │ │ │ │ ├── BeanMapEmitter.java │ │ │ │ ├── BulkBean.java │ │ │ │ ├── BulkBeanEmitter.java │ │ │ │ ├── BulkBeanException.java │ │ │ │ ├── FixedKeySet.java │ │ │ │ └── ImmutableBean.java │ │ │ ├── core │ │ │ │ ├── AbstractClassGenerator.java │ │ │ │ ├── Block.java │ │ │ │ ├── ClassEmitter.java │ │ │ │ ├── ClassGenerator.java │ │ │ │ ├── ClassInfo.java │ │ │ │ ├── ClassNameReader.java │ │ │ │ ├── ClassesKey.java │ │ │ │ ├── CodeEmitter.java │ │ │ │ ├── CodeGenerationException.java │ │ │ │ ├── CollectionUtils.java │ │ │ │ ├── Constants.java │ │ │ │ ├── Converter.java │ │ │ │ ├── Customizer.java │ │ │ │ ├── DebuggingClassWriter.java │ │ │ │ ├── DefaultGeneratorStrategy.java │ │ │ │ ├── DefaultNamingPolicy.java │ │ │ │ ├── DuplicatesPredicate.java │ │ │ │ ├── EmitUtils.java │ │ │ │ ├── GeneratorStrategy.java │ │ │ │ ├── KeyFactory.java │ │ │ │ ├── Local.java │ │ │ │ ├── LocalVariablesSorter.java │ │ │ │ ├── MethodInfo.java │ │ │ │ ├── MethodInfoTransformer.java │ │ │ │ ├── MethodWrapper.java │ │ │ │ ├── NamingPolicy.java │ │ │ │ ├── ObjectSwitchCallback.java │ │ │ │ ├── Predicate.java │ │ │ │ ├── ProcessArrayCallback.java │ │ │ │ ├── ProcessSwitchCallback.java │ │ │ │ ├── ReflectUtils.java │ │ │ │ ├── RejectModifierPredicate.java │ │ │ │ ├── Signature.java │ │ │ │ ├── TinyBitSet.java │ │ │ │ ├── Transformer.java │ │ │ │ ├── TypeUtils.java │ │ │ │ └── VisibilityPredicate.java │ │ │ ├── proxy │ │ │ │ ├── BridgeMethodResolver.java │ │ │ │ ├── Callback.java │ │ │ │ ├── CallbackFilter.java │ │ │ │ ├── CallbackGenerator.java │ │ │ │ ├── CallbackHelper.java │ │ │ │ ├── CallbackInfo.java │ │ │ │ ├── Dispatcher.java │ │ │ │ ├── DispatcherGenerator.java │ │ │ │ ├── Enhancer.java │ │ │ │ ├── Factory.java │ │ │ │ ├── FixedValue.java │ │ │ │ ├── FixedValueGenerator.java │ │ │ │ ├── InterfaceMaker.java │ │ │ │ ├── InvocationHandler.java │ │ │ │ ├── InvocationHandlerGenerator.java │ │ │ │ ├── LazyLoader.java │ │ │ │ ├── LazyLoaderGenerator.java │ │ │ │ ├── MethodInterceptor.java │ │ │ │ ├── MethodInterceptorGenerator.java │ │ │ │ ├── MethodProxy.java │ │ │ │ ├── Mixin.java │ │ │ │ ├── MixinBeanEmitter.java │ │ │ │ ├── MixinEmitter.java │ │ │ │ ├── MixinEverythingEmitter.java │ │ │ │ ├── NoOp.java │ │ │ │ ├── NoOpGenerator.java │ │ │ │ ├── Proxy.java │ │ │ │ ├── ProxyRefDispatcher.java │ │ │ │ └── UndeclaredThrowableException.java │ │ │ ├── reflect │ │ │ │ ├── ConstructorDelegate.java │ │ │ │ ├── FastClass.java │ │ │ │ ├── FastClassEmitter.java │ │ │ │ ├── FastConstructor.java │ │ │ │ ├── FastMember.java │ │ │ │ ├── FastMethod.java │ │ │ │ ├── MethodDelegate.java │ │ │ │ └── MulticastDelegate.java │ │ │ ├── transform │ │ │ │ ├── AbstractClassFilterTransformer.java │ │ │ │ ├── AbstractClassLoader.java │ │ │ │ ├── AbstractClassTransformer.java │ │ │ │ ├── AnnotationVisitorTee.java │ │ │ │ ├── ClassEmitterTransformer.java │ │ │ │ ├── ClassFilter.java │ │ │ │ ├── ClassFilterTransformer.java │ │ │ │ ├── ClassReaderGenerator.java │ │ │ │ ├── ClassTransformer.java │ │ │ │ ├── ClassTransformerChain.java │ │ │ │ ├── ClassTransformerFactory.java │ │ │ │ ├── ClassTransformerTee.java │ │ │ │ ├── ClassVisitorTee.java │ │ │ │ ├── FieldVisitorTee.java │ │ │ │ ├── MethodFilter.java │ │ │ │ ├── MethodFilterTransformer.java │ │ │ │ ├── MethodVisitorTee.java │ │ │ │ ├── TransformingClassGenerator.java │ │ │ │ ├── TransformingClassLoader.java │ │ │ │ └── impl │ │ │ │ │ ├── AbstractInterceptFieldCallback.java │ │ │ │ │ ├── AccessFieldTransformer.java │ │ │ │ │ ├── AddDelegateTransformer.java │ │ │ │ │ ├── AddInitTransformer.java │ │ │ │ │ ├── AddPropertyTransformer.java │ │ │ │ │ ├── AddStaticInitTransformer.java │ │ │ │ │ ├── FieldProvider.java │ │ │ │ │ ├── FieldProviderTransformer.java │ │ │ │ │ ├── InterceptFieldCallback.java │ │ │ │ │ ├── InterceptFieldEnabled.java │ │ │ │ │ ├── InterceptFieldFilter.java │ │ │ │ │ ├── InterceptFieldTransformer.java │ │ │ │ │ ├── UndeclaredThrowableStrategy.java │ │ │ │ │ └── UndeclaredThrowableTransformer.java │ │ │ └── util │ │ │ │ ├── ParallelSorter.java │ │ │ │ ├── ParallelSorterEmitter.java │ │ │ │ ├── SorterTemplate.java │ │ │ │ └── StringSwitcher.java │ │ │ ├── jbeanbox │ │ │ ├── AopUtils.java │ │ │ ├── BeanBox.java │ │ │ ├── BeanBoxContext.java │ │ │ ├── BeanBoxException.java │ │ │ ├── BeanBoxUtils.java │ │ │ ├── ClassScanner.java │ │ │ ├── EMPTY.java │ │ │ ├── JBEANBOX.java │ │ │ ├── NameMatchUtil.java │ │ │ ├── PrototypeBean.java │ │ │ ├── ProxyBean.java │ │ │ ├── ReflectionUtils.java │ │ │ ├── ValueTranslator.java │ │ │ └── annotation │ │ │ │ ├── AOP.java │ │ │ │ ├── COMPONENT.java │ │ │ │ ├── INJECT.java │ │ │ │ ├── NAMED.java │ │ │ │ ├── POSTCONSTRUCT.java │ │ │ │ ├── PREDESTROY.java │ │ │ │ ├── PROTOTYPE.java │ │ │ │ ├── QUALIFILER.java │ │ │ │ └── VALUE.java │ │ │ ├── jdbpro │ │ │ ├── ClassTranslator.java │ │ │ ├── CustomizedSqlItem.java │ │ │ ├── DbPro.java │ │ │ ├── DbProException.java │ │ │ ├── DefaultOrderSqlHandler.java │ │ │ ├── ImprovedQueryRunner.java │ │ │ ├── JDBC.java │ │ │ ├── JDBPRO.java │ │ │ ├── JdbcContext.java │ │ │ ├── LinkArrayList.java │ │ │ ├── PackageInfo.java │ │ │ ├── PreparedSQL.java │ │ │ ├── SingleTonHandlers.java │ │ │ ├── SqlHandler.java │ │ │ ├── SqlItem.java │ │ │ ├── SqlItemHandler.java │ │ │ ├── SqlOption.java │ │ │ ├── TenantGetter.java │ │ │ ├── Text.java │ │ │ ├── TextUtils.java │ │ │ ├── TxBody.java │ │ │ ├── handler │ │ │ │ ├── CamelHander.java │ │ │ │ ├── PaginHandler.java │ │ │ │ ├── PrintSqlHandler.java │ │ │ │ ├── SimpleCacheHandler.java │ │ │ │ └── TitleArrayListHandler.java │ │ │ └── template │ │ │ │ ├── BasicSqlTemplate.java │ │ │ │ └── SqlTemplateEngine.java │ │ │ ├── jdialects │ │ │ ├── ArrayUtils.java │ │ │ ├── ClassCacheUtils.java │ │ │ ├── DDLCreateUtils.java │ │ │ ├── DDLDropUtils.java │ │ │ ├── DDLFeatures.java │ │ │ ├── DDLFormatter.java │ │ │ ├── DebugUtils.java │ │ │ ├── Dialect.java │ │ │ ├── DialectException.java │ │ │ ├── DialectFunctionTemplate.java │ │ │ ├── DialectFunctionTranslator.java │ │ │ ├── DialectFunctionUtils.java │ │ │ ├── DialectPaginationTemplate.java │ │ │ ├── DialectType.java │ │ │ ├── DialectTypeMappingTemplate.java │ │ │ ├── GuessDialectUtils.java │ │ │ ├── Java8DateUtils.java │ │ │ ├── JdbcUtil.java │ │ │ ├── NamingConversion.java │ │ │ ├── PackageInfo.java │ │ │ ├── ReservedDBWords.java │ │ │ ├── SqlFormatter.java │ │ │ ├── StrUtils.java │ │ │ ├── TableModelUtils.java │ │ │ ├── TableModelUtilsOfDb.java │ │ │ ├── TableModelUtilsOfEntity.java │ │ │ ├── TableModelUtilsOfExcel.java │ │ │ ├── TableModelUtilsOfJavaSrc.java │ │ │ ├── Type.java │ │ │ ├── TypeUtils.java │ │ │ ├── annotation │ │ │ │ ├── jdia │ │ │ │ │ ├── AutoId.java │ │ │ │ │ ├── COLUMN.java │ │ │ │ │ ├── CreateTimestamp.java │ │ │ │ │ ├── CreatedBy.java │ │ │ │ │ ├── FKey.java │ │ │ │ │ ├── FKey1.java │ │ │ │ │ ├── FKey2.java │ │ │ │ │ ├── FKey3.java │ │ │ │ │ ├── IdentityId.java │ │ │ │ │ ├── LastModifiedBy.java │ │ │ │ │ ├── PKey.java │ │ │ │ │ ├── ShardDatabase.java │ │ │ │ │ ├── ShardTable.java │ │ │ │ │ ├── SingleFKey.java │ │ │ │ │ ├── SingleIndex.java │ │ │ │ │ ├── SingleUnique.java │ │ │ │ │ ├── Snowflake.java │ │ │ │ │ ├── TimeStampId.java │ │ │ │ │ ├── UUID.java │ │ │ │ │ ├── UUID25.java │ │ │ │ │ ├── UUID26.java │ │ │ │ │ ├── UUID32.java │ │ │ │ │ ├── UUID36.java │ │ │ │ │ ├── UUIDAny.java │ │ │ │ │ └── UpdateTimestamp.java │ │ │ │ └── jpa │ │ │ │ │ ├── Column.java │ │ │ │ │ ├── Convert.java │ │ │ │ │ ├── Entity.java │ │ │ │ │ ├── EnumType.java │ │ │ │ │ ├── Enumerated.java │ │ │ │ │ ├── GeneratedValue.java │ │ │ │ │ ├── GenerationType.java │ │ │ │ │ ├── Id.java │ │ │ │ │ ├── Index.java │ │ │ │ │ ├── SequenceGenerator.java │ │ │ │ │ ├── Table.java │ │ │ │ │ ├── TableGenerator.java │ │ │ │ │ ├── Temporal.java │ │ │ │ │ ├── TemporalType.java │ │ │ │ │ ├── Transient.java │ │ │ │ │ ├── UniqueConstraint.java │ │ │ │ │ └── Version.java │ │ │ ├── converter │ │ │ │ ├── BasicJavaConverter.java │ │ │ │ ├── BasicJavaToJdbcConverter.java │ │ │ │ ├── BasicJdbcToJavaConverter.java │ │ │ │ ├── JavaConverter.java │ │ │ │ ├── JavaToJdbcConverter.java │ │ │ │ └── JdbcToJavaConverter.java │ │ │ ├── id │ │ │ │ ├── AutoIdGenerator.java │ │ │ │ ├── IdGenerator.java │ │ │ │ ├── IdentityIdGenerator.java │ │ │ │ ├── SequenceIdGenerator.java │ │ │ │ ├── SnowflakeCreator.java │ │ │ │ ├── SnowflakeGenerator.java │ │ │ │ ├── SortedUUIDGenerator.java │ │ │ │ ├── TableIdGenerator.java │ │ │ │ ├── TimeStampIdGenerator.java │ │ │ │ ├── UUID25Generator.java │ │ │ │ ├── UUID26Generator.java │ │ │ │ ├── UUID32Generator.java │ │ │ │ ├── UUID36Generator.java │ │ │ │ ├── UUIDAnyGenerator.java │ │ │ │ └── UUIDGenerator.java │ │ │ ├── model │ │ │ │ ├── ColumnModel.java │ │ │ │ ├── FKeyModel.java │ │ │ │ ├── IndexModel.java │ │ │ │ ├── TableModel.java │ │ │ │ └── UniqueModel.java │ │ │ └── springsrc │ │ │ │ ├── PackageInfo.java │ │ │ │ └── utils │ │ │ │ ├── Assert.java │ │ │ │ ├── ClassUtils.java │ │ │ │ ├── CollectionUtils.java │ │ │ │ ├── ConcurrentReferenceHashMap.java │ │ │ │ ├── ObjectUtils.java │ │ │ │ ├── ReflectionUtils.java │ │ │ │ └── StringUtils.java │ │ │ ├── jlogs │ │ │ ├── ConsoleLog.java │ │ │ ├── EmptyLog.java │ │ │ ├── Log.java │ │ │ ├── LogFactory.java │ │ │ └── SimpleSLF4JLog.java │ │ │ ├── jsqlbox │ │ │ ├── ActiveEntity.java │ │ │ ├── ActiveRecord.java │ │ │ ├── AliasProxyUtil.java │ │ │ ├── CacheTransUtils.java │ │ │ ├── DB.java │ │ │ ├── DbContext.java │ │ │ ├── DbContextUtils.java │ │ │ ├── DbException.java │ │ │ ├── EntityType.java │ │ │ ├── GraphQuery.java │ │ │ ├── JAVA8.java │ │ │ ├── JSQLBOX.java │ │ │ ├── LambdSqlItem.java │ │ │ ├── SQL.java │ │ │ ├── SqlBoxContext.java │ │ │ ├── Tail.java │ │ │ ├── TailType.java │ │ │ ├── converter │ │ │ │ ├── BaseFieldConverter.java │ │ │ │ ├── EnumOrdinalFieldConverter.java │ │ │ │ ├── EnumStringFieldConverter.java │ │ │ │ ├── FieldConverter.java │ │ │ │ ├── FieldConverterUtils.java │ │ │ │ └── VersionFieldConverter.java │ │ │ ├── entitynet │ │ │ │ ├── EntityIdUtils.java │ │ │ │ └── EntityNet.java │ │ │ ├── gtx │ │ │ │ ├── GtxAOP.java │ │ │ │ ├── GtxConnectionManager.java │ │ │ │ ├── GtxId.java │ │ │ │ ├── GtxInfo.java │ │ │ │ ├── GtxLock.java │ │ │ │ ├── GtxLog.java │ │ │ │ ├── GtxTag.java │ │ │ │ ├── GtxUnlockServ.java │ │ │ │ └── GtxUtils.java │ │ │ ├── handler │ │ │ │ ├── EntityListHandler.java │ │ │ │ ├── EntityNetHandler.java │ │ │ │ ├── SSHandler.java │ │ │ │ ├── SSMapListHandler.java │ │ │ │ └── SSTitleArrayListHandler.java │ │ │ ├── sharding │ │ │ │ ├── ShardingModTool.java │ │ │ │ ├── ShardingRangeTool.java │ │ │ │ ├── ShardingTool.java │ │ │ │ └── ShardingUtils.java │ │ │ └── sqlitem │ │ │ │ ├── EntityKeyItem.java │ │ │ │ └── SampleItem.java │ │ │ └── jtransactions │ │ │ ├── ConnectionManager.java │ │ │ ├── DataSourceHolder.java │ │ │ ├── PackageInfo.java │ │ │ ├── ThreadConnectionManager.java │ │ │ ├── TransactionsException.java │ │ │ ├── TxInfo.java │ │ │ ├── TxResult.java │ │ │ ├── grouptx │ │ │ ├── GroupTx.java │ │ │ ├── GroupTxAOP.java │ │ │ └── GroupTxConnectionManager.java │ │ │ ├── jfinal │ │ │ └── JFinalTxConnectionManager.java │ │ │ ├── manual │ │ │ └── ManualTxConnectionManager.java │ │ │ ├── spring │ │ │ └── SpringTxConnectionManager.java │ │ │ └── tinytx │ │ │ ├── TinyTxAOP.java │ │ │ └── TinyTxConnectionManager.java │ │ ├── javax │ │ ├── annotation │ │ │ ├── PostConstruct.java │ │ │ └── PreDestroy.java │ │ └── inject │ │ │ ├── Inject.java │ │ │ ├── Named.java │ │ │ ├── Provider.java │ │ │ ├── Qualifier.java │ │ │ ├── Scope.java │ │ │ └── Singleton.java │ │ └── org │ │ ├── aopalliance │ │ ├── aop │ │ │ ├── Advice.java │ │ │ └── AspectException.java │ │ └── intercept │ │ │ ├── ConstructorInterceptor.java │ │ │ ├── ConstructorInvocation.java │ │ │ ├── Interceptor.java │ │ │ ├── Invocation.java │ │ │ ├── Joinpoint.java │ │ │ ├── MethodInterceptor.java │ │ │ └── MethodInvocation.java │ │ ├── apache │ │ └── commons │ │ │ └── dbutils │ │ │ ├── AbstractQueryRunner.java │ │ │ ├── AsyncQueryRunner.java │ │ │ ├── BaseResultSetHandler.java │ │ │ ├── BasicRowProcessor.java │ │ │ ├── BeanProcessor.java │ │ │ ├── ColumnHandler.java │ │ │ ├── DbUtils.java │ │ │ ├── GenerousBeanProcessor.java │ │ │ ├── OutParameter.java │ │ │ ├── PropertyHandler.java │ │ │ ├── ProxyFactory.java │ │ │ ├── QueryLoader.java │ │ │ ├── QueryRunner.java │ │ │ ├── ResultSetHandler.java │ │ │ ├── ResultSetIterator.java │ │ │ ├── RowProcessor.java │ │ │ ├── StatementConfiguration.java │ │ │ ├── handlers │ │ │ ├── AbstractKeyedHandler.java │ │ │ ├── AbstractListHandler.java │ │ │ ├── ArrayHandler.java │ │ │ ├── ArrayListHandler.java │ │ │ ├── BeanHandler.java │ │ │ ├── BeanListHandler.java │ │ │ ├── BeanMapHandler.java │ │ │ ├── ColumnListHandler.java │ │ │ ├── KeyedHandler.java │ │ │ ├── MapHandler.java │ │ │ ├── MapListHandler.java │ │ │ ├── ScalarHandler.java │ │ │ ├── columns │ │ │ │ ├── BooleanColumnHandler.java │ │ │ │ ├── ByteColumnHandler.java │ │ │ │ ├── DoubleColumnHandler.java │ │ │ │ ├── FloatColumnHandler.java │ │ │ │ ├── IntegerColumnHandler.java │ │ │ │ ├── LongColumnHandler.java │ │ │ │ ├── SQLXMLColumnHandler.java │ │ │ │ ├── ShortColumnHandler.java │ │ │ │ ├── StringColumnHandler.java │ │ │ │ └── TimestampColumnHandler.java │ │ │ ├── package-info.java │ │ │ └── properties │ │ │ │ ├── DatePropertyHandler.java │ │ │ │ └── StringEnumPropertyHandler.java │ │ │ ├── package-info.java │ │ │ └── wrappers │ │ │ ├── SqlNullCheckedResultSet.java │ │ │ ├── StringTrimmedResultSet.java │ │ │ └── package-info.java │ │ └── springframework │ │ ├── beans │ │ └── factory │ │ │ └── annotation │ │ │ ├── Autowired.java │ │ │ ├── Qualifier.java │ │ │ └── Value.java │ │ └── stereotype │ │ ├── Component.java │ │ ├── Controller.java │ │ ├── Repository.java │ │ └── Service.java │ └── test │ ├── java │ └── com │ │ └── github │ │ └── drinkjava2 │ │ ├── common │ │ ├── DataSourceConfig.java │ │ ├── Readme.java │ │ └── Systemout.java │ │ ├── jdbpro │ │ └── HelloWorld.java │ │ ├── jdialects │ │ ├── ClassCacheUtilsTest.java │ │ ├── Java8DateUtilsTest.java │ │ ├── NamingConversionTest.java │ │ ├── SampleDialectTest.java │ │ ├── TableModelTest.java │ │ ├── ToExcelTest.java │ │ ├── config │ │ │ └── JdialectsTestBase.java │ │ ├── entity │ │ │ ├── RoleTB.java │ │ │ └── UserTB.java │ │ └── function │ │ │ ├── AnnotationTest.java │ │ │ ├── DDLFormatterTest.java │ │ │ ├── DDLTest.java │ │ │ ├── Db2ModelsTest.java │ │ │ ├── DialectTest.java │ │ │ ├── EntityAnnotationTest.java │ │ │ ├── FunctionTranslateTest.java │ │ │ ├── ReservedDBWordsTest.java │ │ │ ├── SqlFormatterTest.java │ │ │ └── StrUtilsTest.java │ │ ├── jsqlbox │ │ ├── benchmark │ │ │ ├── BenchMarkTest.java │ │ │ ├── Debuger.java │ │ │ ├── DemoCustomer.java │ │ │ ├── DemoOrder.java │ │ │ ├── DemoUser.java │ │ │ └── TestServiceInterface.java │ │ ├── config │ │ │ └── TestBase.java │ │ ├── function │ │ │ ├── BatchInsertTest.java │ │ │ ├── BatchTest.java │ │ │ ├── CacheTranslateTest.java │ │ │ ├── CamelHanderTest.java │ │ │ ├── CompoundPKeyTest.java │ │ │ ├── ConverterTest.java │ │ │ ├── CrudCompoundIdTest.java │ │ │ ├── CrudTest.java │ │ │ ├── CustomizedSqlItemTest.java │ │ │ ├── DbProLogTest.java │ │ │ ├── DynamicConfigTest.java │ │ │ ├── DynamicPojoConfigTest.java │ │ │ ├── EnumTest.java │ │ │ ├── IdGeneratorInEntityTest.java │ │ │ ├── IdGeneratorTest.java │ │ │ ├── MasterSlaveTest.java │ │ │ ├── OthersTest.java │ │ │ ├── ShardingModToolTest.java │ │ │ ├── ShardingRangeToolTest.java │ │ │ ├── ShardingShardMethodTest.java │ │ │ ├── SqlHandlerGlobalAndThreadedTest.java │ │ │ ├── SqlHandlersTest.java │ │ │ ├── TailTest.java │ │ │ ├── TenantTest.java │ │ │ ├── TextUtilsTest.java │ │ │ ├── UUIDGeneratorsTest.java │ │ │ ├── VersionTest.java │ │ │ ├── entitynet │ │ │ │ ├── EntityNetTest.java │ │ │ │ ├── EntityNetTreeTest.java │ │ │ │ ├── GraphQueryTest.java │ │ │ │ └── entity │ │ │ │ │ ├── Address.java │ │ │ │ │ ├── Email.java │ │ │ │ │ ├── Privilege.java │ │ │ │ │ ├── Role.java │ │ │ │ │ ├── RolePrivilege.java │ │ │ │ │ ├── TreeNode.java │ │ │ │ │ ├── User.java │ │ │ │ │ └── UserRole.java │ │ │ ├── gtx │ │ │ │ ├── GtxShardDbTbLockDbTest.java │ │ │ │ ├── GtxShardDbTbTest.java │ │ │ │ ├── GtxShardDbTest.java │ │ │ │ ├── GtxShardTbTest.java │ │ │ │ ├── GtxTest.java │ │ │ │ └── GtxUnlockServTest.java │ │ │ ├── jdialects │ │ │ │ ├── ColumnTest.java │ │ │ │ ├── EntitySuperclassTest.java │ │ │ │ ├── IdentityIdTest.java │ │ │ │ ├── SqlServerPaginTest.java │ │ │ │ ├── TableModelUtilsOfDbTest.java │ │ │ │ ├── TableModelUtilsOfJavaSrcTest.java │ │ │ │ └── typemapping │ │ │ │ │ ├── DateExtendsTest.java │ │ │ │ │ ├── DateTest.java │ │ │ │ │ ├── DatetimeTimestampTest.java │ │ │ │ │ ├── Java8DateTimeTest.java │ │ │ │ │ └── TypeMappingTest.java │ │ │ ├── jtransactions │ │ │ │ ├── Usr.java │ │ │ │ ├── grouptx │ │ │ │ │ ├── AnnotationGroupTxTest.java │ │ │ │ │ ├── GroupShardTxTest.java │ │ │ │ │ └── GroupTxTest.java │ │ │ │ ├── manultx │ │ │ │ │ └── ManualTxTest.java │ │ │ │ └── tinytx │ │ │ │ │ ├── AnnotationTxDemoTest.java │ │ │ │ │ ├── AnnotationTxTest.java │ │ │ │ │ ├── JavaTxDemoTest.java │ │ │ │ │ ├── JavaTxTest.java │ │ │ │ │ ├── TinyTxTest.java │ │ │ │ │ └── TxMethodTest.java │ │ │ └── quote_column │ │ │ │ ├── QuoteColumnEntityNetTest.java │ │ │ │ ├── QuoteColumnMySqlTest.java │ │ │ │ ├── QuoteColumnOracleTest.java │ │ │ │ ├── QuoteTableEntityNetTest.java │ │ │ │ └── QuoteTableMySqlTest.java │ │ ├── helloworld │ │ │ ├── ActiveRecordDemoTest.java │ │ │ ├── HelloWorld.java │ │ │ └── UsageAndSpeedTest.java │ │ ├── issues │ │ │ ├── I1L5ND_mysql_int_id │ │ │ │ └── I1L5NDTest.java │ │ │ ├── IYDU7_orm_demo │ │ │ │ ├── Ademo.java │ │ │ │ ├── Bdemo.java │ │ │ │ ├── Cdemo.java │ │ │ │ └── IYDU7Test.java │ │ │ └── Readme.java │ │ └── java8 │ │ │ ├── ActiveEntityTest.java │ │ │ ├── HelloWorld.java │ │ │ ├── Java6ExampleTest.java │ │ │ ├── Java8EampleTest.java │ │ │ ├── TransactionDemo.java │ │ │ └── User.java │ │ ├── jtransactions │ │ ├── config │ │ │ └── JTransTinyJdbc.java │ │ └── tinytx │ │ │ └── TinyTxTester.java │ │ └── util │ │ └── JsonUtil.java │ └── resources │ └── text │ └── TextTest.java ├── demo ├── jsqlbox-actframework │ ├── README.md │ ├── maven_clean.bat │ ├── maven_eclipse_clean.bat │ ├── maven_eclipse_eclipse.bat │ ├── mvn clean compile execexec.bat │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── demo │ │ │ └── transaction │ │ │ └── jsqlbox │ │ │ ├── Account.java │ │ │ ├── MyTX.java │ │ │ └── TransactionDemo.java │ │ └── resources │ │ ├── asset │ │ └── js │ │ │ ├── jquery-1.11.3.min.js │ │ │ └── jquery-ajax-ext.js │ │ ├── conf │ │ └── application.properties │ │ ├── logback.xml │ │ └── rythm │ │ └── demo │ │ └── transaction │ │ └── jsqlbox │ │ └── TransactionDemo │ │ └── home.html ├── jsqlbox-atomikos │ ├── README.md │ ├── maven_clean.bat │ ├── maven_eclipse_clean.bat │ ├── maven_eclipse_eclipse.bat │ ├── maven_test.bat │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── jsqlboxtx │ │ │ ├── NonXATransactionTest.java │ │ │ └── XATransactionTest.java │ │ └── resources │ │ ├── jta.properties │ │ └── simplelogger.properties ├── jsqlbox-beetl │ ├── README.md │ ├── command.bat │ ├── maven_clean.bat │ ├── maven_eclipse_clean.bat │ ├── maven_eclipse_eclipse.bat │ ├── maven_test.bat │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── github │ │ │ └── drinkjava2 │ │ │ └── beetlsqldemo │ │ │ ├── BeetlSqlTempalte.java │ │ │ ├── BeetlSqlTemplateDemoTest.java │ │ │ ├── SQLGrammarCreator.java │ │ │ ├── SQLPlaceholderST.java │ │ │ └── SQLTemplateEngine.java │ │ └── resources │ │ ├── common-logging.properties │ │ ├── log4j.properties │ │ └── sql │ │ └── SQLs.java ├── jsqlbox-helloworld │ ├── maven_clean.bat │ ├── maven_eclipse_clean.bat │ ├── maven_eclipse_eclipse.bat │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── HelloWorld.java ├── jsqlbox-jbooox │ ├── README.md │ ├── deploy_tomcat.bat │ ├── deploy_weblogic.bat │ ├── maven_clean.bat │ ├── maven_eclipse_clean.bat │ ├── maven_eclipse_eclipse.bat │ ├── maven_test.bat │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── jsqlboxdemo │ │ │ │ ├── controller │ │ │ │ ├── BaseBox.java │ │ │ │ ├── home.java │ │ │ │ └── team.java │ │ │ │ ├── dispatcher │ │ │ │ └── Dispatcher.java │ │ │ │ ├── init │ │ │ │ └── Initializer.java │ │ │ │ ├── logger │ │ │ │ └── SampleSLF4JLog.java │ │ │ │ └── service │ │ │ │ └── TeamService.java │ │ ├── resources │ │ │ ├── jlogs.properties │ │ │ ├── logback.xml │ │ │ └── model │ │ │ │ └── Team.java │ │ └── webapp │ │ │ ├── META-INF │ │ │ ├── MANIFEST.MF │ │ │ └── context.xml │ │ │ ├── WEB-INF │ │ │ ├── pages │ │ │ │ ├── home.jsp │ │ │ │ ├── team_add.jsp │ │ │ │ ├── team_edit.jsp │ │ │ │ └── team_list.jsp │ │ │ ├── web.xml │ │ │ └── weblogic.xml │ │ │ └── htm2box.jsp │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── jsqlboxdemo │ │ │ ├── TestBase.java │ │ │ ├── controller │ │ │ └── TeamControllerTest.java │ │ │ ├── integration │ │ │ └── IntegrationTest.java │ │ │ ├── log │ │ │ └── LogTest.java │ │ │ ├── mock │ │ │ ├── MockJspWriter.java │ │ │ ├── MockPageContext.java │ │ │ ├── MockRequest.java │ │ │ └── MockRequestDispatcher.java │ │ │ └── service │ │ │ └── TeamServiceTest.java │ │ └── resources │ │ ├── common-logging.properties │ │ └── log4j.properties ├── jsqlbox-jfinal │ ├── Readme.md │ ├── maven start jfinal.bat │ ├── maven_clean.bat │ ├── maven_clean_package.bat │ ├── maven_eclipse_clean.bat │ ├── maven_eclipse_eclipse.bat │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── demo │ │ │ ├── blog │ │ │ ├── BlogController.java │ │ │ ├── BlogInterceptor.java │ │ │ ├── BlogService.java │ │ │ └── BlogValidator.java │ │ │ ├── common │ │ │ ├── Blog.java │ │ │ └── DemoConfig.java │ │ │ └── index │ │ │ └── IndexController.java │ │ ├── resources │ │ ├── a_little_config.txt │ │ └── log4j.properties │ │ └── webapp │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ ├── WEB-INF │ │ └── web.xml │ │ ├── blog │ │ ├── _form.html │ │ ├── add.html │ │ ├── blog.html │ │ └── edit.html │ │ ├── common │ │ ├── _layout.html │ │ └── _paginate.html │ │ ├── css │ │ └── manage.css │ │ ├── favicon.ico │ │ ├── img │ │ ├── bg.gif │ │ ├── left2.gif │ │ └── right2.gif │ │ ├── index │ │ └── index.html │ │ └── js │ │ └── jquery-1.4.4.min.js ├── jsqlbox-mybatis │ ├── README.md │ ├── maven_clean.bat │ ├── maven_eclipse_clean.bat │ ├── maven_eclipse_eclipse.bat │ ├── maven_test.bat │ ├── mvn spring-boot run.bat │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── jsqlboxinspringboot │ │ │ │ ├── JsqlboxInSpringbootApplication.java │ │ │ │ ├── controller │ │ │ │ └── Controller.java │ │ │ │ ├── entity │ │ │ │ ├── Customer.java │ │ │ │ └── CustomerMapper.java │ │ │ │ └── services │ │ │ │ └── Services.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── jsqlboxinspringboot │ │ └── JsqlboxInSpringbootApplicationTests.java ├── jsqlbox-qclass │ ├── README.md │ ├── command.bat │ ├── maven_clean.bat │ ├── maven_eclipse_clean.bat │ ├── maven_eclipse_eclipse.bat │ ├── maven_test.bat │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── github │ │ └── drinkjava2 │ │ ├── User.java │ │ └── demo │ │ ├── jpa │ │ └── QClassDemo.java │ │ ├── jsqlbox1 │ │ ├── QClassDemo.java │ │ └── QUserDemo.java │ │ └── jsqlbox2 │ │ ├── QClassDemo.java │ │ └── QUserDemo.java ├── jsqlbox-spring │ ├── README.md │ ├── deploy_tomcat.bat │ ├── deploy_weblogic.bat │ ├── maven_clean.bat │ ├── maven_eclipse_clean.bat │ ├── maven_eclipse_eclipse.bat │ ├── maven_test.bat │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── demo │ │ │ │ ├── controller │ │ │ │ ├── LinkController.java │ │ │ │ └── TeamController.java │ │ │ │ ├── init │ │ │ │ ├── Initializer.java │ │ │ │ └── WebAppConfig.java │ │ │ │ ├── model │ │ │ │ └── Team.java │ │ │ │ └── service │ │ │ │ └── TeamService.java │ │ ├── resources │ │ │ ├── common-logging.properties │ │ │ └── log4j.properties │ │ └── webapp │ │ │ ├── META-INF │ │ │ ├── MANIFEST.MF │ │ │ └── maven │ │ │ │ └── com.mvchib │ │ │ │ └── spring │ │ │ │ ├── pom.properties │ │ │ │ └── pom.xml │ │ │ └── WEB-INF │ │ │ ├── pages │ │ │ ├── add-team-form.jsp │ │ │ ├── edit-team-form.jsp │ │ │ ├── home.jsp │ │ │ └── list-of-teams.jsp │ │ │ ├── web.xml │ │ │ └── weblogic.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── demo │ │ ├── init │ │ └── BaseTestConfig.java │ │ ├── services │ │ └── TeamServiceTest.java │ │ └── test │ │ └── LinkControllerTest.java ├── jsqlbox-springboot │ ├── README.md │ ├── maven_clean.bat │ ├── maven_eclipse_clean.bat │ ├── maven_eclipse_eclipse.bat │ ├── maven_test.bat │ ├── mvn spring-boot run.bat │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── jsqlboxinspringboot │ │ │ │ ├── JsqlboxInSpringbootApplication.java │ │ │ │ ├── controller │ │ │ │ └── Controller.java │ │ │ │ ├── entity │ │ │ │ └── Customer.java │ │ │ │ └── services │ │ │ │ └── Services.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── jsqlboxinspringboot │ │ └── JsqlboxInSpringbootApplicationTests.java ├── mvn_clean_all.bat └── mvn_eclipse_all.bat ├── jsqlbox-logo.png ├── orm.png └── tree.png /.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | target/ 3 | bin/ 4 | .project 5 | .classpath 6 | .settings/ 7 | *~ 8 | *.orig 9 | *.new 10 | .idea/ 11 | *.iml 12 | *.ipr 13 | test/**/build/ 14 | examples/**/build/ -------------------------------------------------------------------------------- /arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drinkjava2/jSqlBox/94e2e6ba9101b9aeab0493561aee2bc166957095/arch.png -------------------------------------------------------------------------------- /command.bat: -------------------------------------------------------------------------------- 1 | cmd -------------------------------------------------------------------------------- /core/src/main/java/com/github/drinkjava2/asm/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jBeanBox's repackaging of ASM 3 | * 7.0 for internal use only). 4 | * 5 | *
6 | * This repackaging technique avoids any potential conflicts with dependencies
7 | * on ASM at the application level or from third-party libraries and frameworks.
8 | */
9 | package com.github.drinkjava2.asm;
10 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/Readme.java:
--------------------------------------------------------------------------------
1 |
2 | package com.github.drinkjava2.cglib;//NOSONAR
3 |
4 | /**
5 | * To avoid jar conflict if a project need use other version CGLIB, I included cglib3.2.0 source code in this project
6 | * and changed its package name
7 | *
8 | * @author Yong
9 | * @since 2.4.1
10 | *
11 | */
12 | class Readme {// NOSONAR
13 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/beans/BulkBeanException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.beans;
17 | @SuppressWarnings("serial")
18 | public class BulkBeanException extends RuntimeException
19 | {
20 | private int index;
21 | private Throwable cause;
22 |
23 | public BulkBeanException(String message, int index) {
24 | super(message);
25 | this.index = index;
26 | }
27 |
28 | public BulkBeanException(Throwable cause, int index) {
29 | super(cause.getMessage());
30 | this.index = index;
31 | this.cause = cause;
32 | }
33 |
34 | public int getIndex() {
35 | return index;
36 | }
37 |
38 | public Throwable getCause() {
39 | return cause;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/beans/FixedKeySet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.beans;
17 |
18 | import java.util.*;
19 |
20 | @SuppressWarnings({"rawtypes","unchecked"})
21 | public /* need it for class loading */ class FixedKeySet extends AbstractSet {
22 | private Set set;
23 | private int size;
24 |
25 |
26 | public FixedKeySet(String[] keys) {
27 | size = keys.length;
28 | set = Collections.unmodifiableSet(new HashSet(Arrays.asList(keys)));
29 | }
30 |
31 | public Iterator iterator() {
32 | return set.iterator();
33 | }
34 |
35 | public int size() {
36 | return size;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/Block.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | import com.github.drinkjava2.asm.Label;
19 |
20 | public class Block
21 | {
22 | private CodeEmitter e;
23 | private Label start;
24 | private Label end;
25 |
26 | public Block(CodeEmitter e) {
27 | this.e = e;
28 | start = e.mark();
29 | }
30 |
31 | public CodeEmitter getCodeEmitter() {
32 | return e;
33 | }
34 |
35 | public void end() {
36 | if (end != null) {
37 | throw new IllegalStateException("end of label already set");
38 | }
39 | end = e.mark();
40 | }
41 |
42 | public Label getStart() {
43 | return start;
44 | }
45 |
46 | public Label getEnd() {
47 | return end;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/ClassGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | import com.github.drinkjava2.asm.ClassVisitor;
19 |
20 | public interface ClassGenerator {
21 | void generateClass(ClassVisitor v) throws Exception;
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/ClassesKey.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | public class ClassesKey {
19 | private static final Key FACTORY = (Key)KeyFactory.create(Key.class, KeyFactory.OBJECT_BY_CLASS);
20 |
21 | interface Key {
22 | Object newInstance(Object[] array);
23 | }
24 |
25 | private ClassesKey() {
26 | }
27 |
28 | public static Object create(Object[] array) {
29 | return FACTORY.newInstance(array);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/CodeGenerationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | /**
19 | * @version $Id: CodeGenerationException.java,v 1.3 2004/06/24 21:15:21 herbyderby Exp $
20 | */
21 | @SuppressWarnings("serial")
22 | public class CodeGenerationException extends RuntimeException {
23 | private Throwable cause;
24 |
25 | public CodeGenerationException(Throwable cause) {
26 | super(cause.getClass().getName() + "-->" + cause.getMessage());
27 | this.cause = cause;
28 | }
29 |
30 | public Throwable getCause() {
31 | return cause;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/Converter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 | @SuppressWarnings({"rawtypes"})
18 | public interface Converter {
19 | Object convert(Object value, Class target, Object context);
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/Customizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | import com.github.drinkjava2.asm.Type;
19 |
20 | public interface Customizer {
21 | void customize(CodeEmitter e, Type type);
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/DuplicatesPredicate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | import java.lang.reflect.Method;
19 | import java.util.*;
20 | @SuppressWarnings({"rawtypes","unchecked" })
21 | public class DuplicatesPredicate implements Predicate {
22 | private Set unique = new HashSet();
23 |
24 | public boolean evaluate(Object arg) {
25 | return unique.add(MethodWrapper.create((Method)arg));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/Local.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | import com.github.drinkjava2.asm.Type;
19 |
20 | public class Local
21 | {
22 | private Type type;
23 | private int index;
24 |
25 | public Local(int index, Type type) {
26 | this.type = type;
27 | this.index = index;
28 | }
29 |
30 | public int getIndex() {
31 | return index;
32 | }
33 |
34 | public Type getType() {
35 | return type;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/ObjectSwitchCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | import com.github.drinkjava2.asm.Label;
19 |
20 | public interface ObjectSwitchCallback {
21 | void processCase(Object key, Label end) throws Exception;
22 | void processDefault() throws Exception;
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/Predicate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | public interface Predicate {
19 | boolean evaluate(Object arg);
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/ProcessArrayCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | import com.github.drinkjava2.asm.Type;
19 |
20 | public interface ProcessArrayCallback {
21 | void processElement(Type type);
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/ProcessSwitchCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | import com.github.drinkjava2.asm.Label;
19 |
20 | public interface ProcessSwitchCallback {
21 | void processCase(int key, Label end) throws Exception;
22 | void processDefault() throws Exception;
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/RejectModifierPredicate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2004 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | import java.lang.reflect.*;
19 |
20 | public class RejectModifierPredicate implements Predicate {
21 | private int rejectMask;
22 |
23 | public RejectModifierPredicate(int rejectMask) {
24 | this.rejectMask = rejectMask;
25 | }
26 |
27 | public boolean evaluate(Object arg) {
28 | return (((Member)arg).getModifiers() & rejectMask) == 0;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/core/Transformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.core;
17 |
18 | public interface Transformer {
19 | Object transform(Object value);
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/proxy/Callback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.proxy;
17 |
18 | /**
19 | * All callback interfaces used by {@link Enhancer} extend this interface.
20 | * @see MethodInterceptor
21 | * @see NoOp
22 | * @see LazyLoader
23 | * @see Dispatcher
24 | * @see InvocationHandler
25 | * @see FixedValue
26 | */
27 | public interface Callback
28 | {
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/proxy/Dispatcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.proxy;
17 |
18 | /**
19 | * Dispatching {@link Enhancer} callback. This is identical to the
20 | * {@link LazyLoader} interface but needs to be separate so that Example usage:
27 | *
28 | * A constructor invocation is a joinpoint and can be intercepted
26 | * by a constructor interceptor.
27 | *
28 | * @author Rod Johnson
29 | * @see ConstructorInterceptor
30 | */
31 | public interface ConstructorInvocation extends Invocation {
32 |
33 | /**
34 | * Get the constructor being called.
35 | * This method is a friendly implementation of the
36 | * {@link Joinpoint#getStaticPart()} method (same result).
37 | * @return the constructor being called
38 | */
39 | Constructor> getConstructor();
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/core/src/main/java/org/aopalliance/intercept/Invocation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-2016 the original author or authors.
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 |
17 | package org.aopalliance.intercept;
18 |
19 | /**
20 | * This interface represents an invocation in the program.
21 | *
22 | * An invocation is a joinpoint and can be intercepted by an
23 | * interceptor.
24 | *
25 | * @author Rod Johnson
26 | */
27 | public interface Invocation extends Joinpoint {
28 |
29 | /**
30 | * Get the arguments as an array object.
31 | * It is possible to change element values within this
32 | * array to change the arguments.
33 | * @return the argument of the invocation
34 | */
35 | Object[] getArguments();
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/core/src/main/java/org/aopalliance/intercept/MethodInvocation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-2016 the original author or authors.
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 |
17 | package org.aopalliance.intercept;
18 |
19 | import java.lang.reflect.Method;
20 |
21 | /**
22 | * Description of an invocation to a method, given to an interceptor
23 | * upon method-call.
24 | *
25 | * A method invocation is a joinpoint and can be intercepted by a
26 | * method interceptor.
27 | *
28 | * @author Rod Johnson
29 | * @see MethodInterceptor
30 | */
31 | public interface MethodInvocation extends Invocation {
32 |
33 | /**
34 | * Get the method being called.
35 | * This method is a frienly implementation of the
36 | * {@link Joinpoint#getStaticPart()} method (same result).
37 | * @return the method being called
38 | */
39 | Method getMethod();
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/core/src/main/java/org/apache/commons/dbutils/handlers/columns/SQLXMLColumnHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.dbutils.handlers.columns;
18 |
19 | import java.sql.ResultSet;
20 | import java.sql.SQLException;
21 | import java.sql.SQLXML;
22 |
23 | import org.apache.commons.dbutils.ColumnHandler;
24 |
25 | public class SQLXMLColumnHandler implements ColumnHandler {
26 | @Override
27 | public boolean match(Class> propType) {
28 | return propType.equals(SQLXML.class);
29 | }
30 |
31 | @Override
32 | public Object apply(ResultSet rs, int columnIndex) throws SQLException {
33 | return rs.getSQLXML(columnIndex);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/core/src/main/java/org/apache/commons/dbutils/handlers/columns/StringColumnHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.dbutils.handlers.columns;
18 |
19 | import java.sql.ResultSet;
20 | import java.sql.SQLException;
21 |
22 | import org.apache.commons.dbutils.ColumnHandler;
23 |
24 | public class StringColumnHandler implements ColumnHandler {
25 | @Override
26 | public boolean match(Class> propType) {
27 | return propType.equals(String.class);
28 | }
29 |
30 | @Override
31 | public Object apply(ResultSet rs, int columnIndex) throws SQLException {
32 | return rs.getString(columnIndex);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/core/src/main/java/org/apache/commons/dbutils/handlers/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | * Implementations of the org.apache.commons.dbutils.ResultSetHandler interface.
20 | */
21 | package org.apache.commons.dbutils.handlers;
22 |
--------------------------------------------------------------------------------
/core/src/main/java/org/apache/commons/dbutils/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | * DbUtils is a small set of classes designed to make working with JDBC easier. JDBC resource cleanup code is mundane,
20 | * error prone work so these classes abstract out all of the cleanup tasks from your code leaving you with what you
21 | * really wanted to do with JDBC in the first place: query and update data.
22 | *
23 | * This package contains the core classes and interfaces - DbUtils, QueryRunner and the ResultSetHandler interface
24 | * should be your first items of interest.
25 | */
26 | package org.apache.commons.dbutils;
27 |
--------------------------------------------------------------------------------
/core/src/main/java/org/apache/commons/dbutils/wrappers/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | * Wrappers that add functionality to java.sql classes.
20 | */
21 | package org.apache.commons.dbutils.wrappers;
22 |
--------------------------------------------------------------------------------
/core/src/test/java/com/github/drinkjava2/common/Readme.java:
--------------------------------------------------------------------------------
1 | package com.github.drinkjava2.common;
2 |
3 | /**
4 | * Read me
5 | *
6 | * @author Yong Zhu
7 | * @since 2.0.5
8 | */
9 | public class Readme {
10 | // Classes in common folder will be used for all unit test
11 | }
12 |
--------------------------------------------------------------------------------
/core/src/test/java/com/github/drinkjava2/common/Systemout.java:
--------------------------------------------------------------------------------
1 | package com.github.drinkjava2.common;
2 |
3 | /**
4 | * Debug Util
5 | *
6 | * @author Yong Zhu
7 | * @since 2.0.5
8 | */
9 | @SuppressWarnings("all")
10 | public class Systemout {
11 | private static boolean allowPrint = false; //开发期打开好显示输出内容,提交时关闭以减少命令行输出
12 |
13 | public static boolean isAllowPrint() {
14 | return allowPrint;
15 | }
16 |
17 | public static void setAllowPrint(boolean allowPrint) {
18 | Systemout.allowPrint = allowPrint;
19 | }
20 |
21 | public static void print(Object obj) {
22 | if (allowPrint)
23 | System.out.print(obj);
24 | }
25 |
26 | public static void println(Object obj) {
27 | if (allowPrint)
28 | System.out.println(obj);
29 | }
30 |
31 | public static void println() {
32 | if (allowPrint)
33 | System.out.println();
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/core/src/test/java/com/github/drinkjava2/jdialects/NamingConversionTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 | * use this file except in compliance with the License.
5 | */
6 | package com.github.drinkjava2.jdialects;
7 |
8 | import org.junit.Assert;
9 | import org.junit.Test;
10 |
11 | /**
12 | *
13 | * @author Yong Z.
14 | * @since 5.0.10
15 | *
16 | */
17 | public class NamingConversionTest {
18 |
19 | @Test
20 | public void doTest() {
21 | Assert.assertEquals("naming_conversion_test", NamingConversion.LOWER_CASE_UNDERSCORE.getTableName(NamingConversionTest.class));
22 | Assert.assertEquals("order_price", NamingConversion.LOWER_CASE_UNDERSCORE.getColumnName("OrderPrice"));
23 | Assert.assertEquals("NAMING_CONVERSION_TEST", NamingConversion.UPPER_CASE_UNDERSCORE.getTableName(NamingConversionTest.class));
24 | Assert.assertEquals("ORDER_PRICE", NamingConversion.UPPER_CASE_UNDERSCORE.getColumnName("OrderPrice"));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/test/java/com/github/drinkjava2/jdialects/ToExcelTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 | * use this file except in compliance with the License.
5 | */
6 | package com.github.drinkjava2.jdialects;
7 |
8 | import java.sql.SQLException;
9 |
10 | import org.junit.Test;
11 |
12 | import com.github.drinkjava2.jdialects.config.JdialectsTestBase;
13 | import com.github.drinkjava2.jdialects.entity.RoleTB;
14 | import com.github.drinkjava2.jdialects.entity.UserTB;
15 |
16 | public class ToExcelTest extends JdialectsTestBase {
17 |
18 | private static boolean isWindows() {
19 | String os = System.getProperty("os.name");
20 | return os.toLowerCase().startsWith("win");
21 | }
22 |
23 |
24 |
25 | @Test
26 | public void doTestPackage2Excel() {
27 | if (isWindows())
28 | TableModelUtils.entityPackage2Excel("com.github.drinkjava2.jdialects.entity", "c:/tmp/jsqlbox_test_packageOutput.csv");
29 | }
30 |
31 | @Test
32 | public void doTestEntity2Excel() {
33 | if (isWindows())
34 | TableModelUtils.entity2Excel("c:/tmp/jsqlbox_test_entitiesOutput.csv", RoleTB.class, UserTB.class);
35 | }
36 |
37 | @Test
38 | public void doTestDb2Excel() throws SQLException {
39 | if (isWindows())
40 | TableModelUtils.db2Excel(ds.getConnection(), Dialect.MySQL57Dialect, "c:/tmp/jsqlbox_test_dbOutput.csv");
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/core/src/test/java/com/github/drinkjava2/jdialects/entity/RoleTB.java:
--------------------------------------------------------------------------------
1 | package com.github.drinkjava2.jdialects.entity;
2 |
3 | import com.github.drinkjava2.jdialects.annotation.jpa.Id;
4 | import com.github.drinkjava2.jdialects.annotation.jpa.Table;
5 | import com.github.drinkjava2.jdialects.annotation.jpa.Transient;
6 |
7 | @Table(name = "roletb")
8 | public class RoleTB {
9 | @Id
10 | String id;
11 |
12 | String roleName;
13 |
14 | @Transient
15 | UserTB user;
16 |
17 | public String getId() {
18 | return id;
19 | }
20 |
21 | public void setId(String id) {
22 | this.id = id;
23 | }
24 |
25 | public String getRoleName() {
26 | return roleName;
27 | }
28 |
29 | public void setRoleName(String roleName) {
30 | this.roleName = roleName;
31 | }
32 |
33 | public UserTB getUser() {
34 | return user;
35 | }
36 |
37 | public void setUser(UserTB user) {
38 | this.user = user;
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/core/src/test/java/com/github/drinkjava2/jdialects/entity/UserTB.java:
--------------------------------------------------------------------------------
1 | package com.github.drinkjava2.jdialects.entity;
2 |
3 | import java.util.List;
4 |
5 | import com.github.drinkjava2.jdialects.annotation.jpa.Id;
6 | import com.github.drinkjava2.jdialects.annotation.jpa.Table;
7 | import com.github.drinkjava2.jdialects.annotation.jpa.Transient;
8 |
9 | @Table(name = "usertb")
10 | public class UserTB {
11 | @Id
12 | String id;
13 |
14 | String userName;
15 |
16 | String teatherId;
17 |
18 | String bossId;
19 |
20 | Integer age;
21 |
22 | @Transient
23 | ListEnhancer
21 | * knows which type of code to generate.
22 | */
23 | public interface Dispatcher extends Callback {
24 | /**
25 | * Return the object which the original method invocation should
26 | * be dispatched. This method is called for every method invocation.
27 | * @return an object that can invoke the method
28 | */
29 | Object loadObject() throws Exception;
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/proxy/LazyLoader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.proxy;
17 |
18 | /**
19 | * Lazy-loading {@link Enhancer} callback.
20 | */
21 | public interface LazyLoader extends Callback {
22 | /**
23 | * Return the object which the original method invocation should be
24 | * dispatched. Called as soon as the first lazily-loaded method in
25 | * the enhanced instance is invoked. The same object is then used
26 | * for every future method call to the proxy instance.
27 | * @return an object that can invoke the method
28 | */
29 | Object loadObject() throws Exception;
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/proxy/NoOp.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.proxy;
17 |
18 | /**
19 | * Methods using this {@link Enhancer} callback will delegate directly to the
20 | * default (super) implementation in the base class.
21 | */
22 | public interface NoOp extends Callback
23 | {
24 | /**
25 | * A thread-safe singleton instance of the NoOp
callback.
26 | */
27 | public static final NoOp INSTANCE = new NoOp() { };
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/proxy/ProxyRefDispatcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.proxy;
17 |
18 | /**
19 | * Dispatching {@link Enhancer} callback. This is the same as the
20 | * {@link Dispatcher} except for the addition of an argument
21 | * which references the proxy object.
22 | */
23 | public interface ProxyRefDispatcher extends Callback {
24 | /**
25 | * Return the object which the original method invocation should
26 | * be dispatched. This method is called for every method invocation.
27 | * @param proxy a reference to the proxy (generated) object
28 | * @return an object that can invoke the method
29 | */
30 | Object loadObject(Object proxy) throws Exception;
31 | }
32 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/proxy/UndeclaredThrowableException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002,2003 The Apache Software Foundation
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 |
17 | package com.github.drinkjava2.cglib.proxy;
18 |
19 | import com.github.drinkjava2.cglib.core.CodeGenerationException;
20 |
21 | /**
22 | * Used by {@link Proxy} as a replacement for java.lang.reflect.UndeclaredThrowableException
.
23 | * @author Juozas Baliuka
24 | */
25 | @SuppressWarnings("serial")
26 | public class UndeclaredThrowableException extends CodeGenerationException {
27 | /**
28 | * Creates a new instance of UndeclaredThrowableException
without detail message.
29 | */
30 | public UndeclaredThrowableException(Throwable t) {
31 | super(t);
32 | }
33 |
34 | public Throwable getUndeclaredThrowable() {
35 | return getCause();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/AbstractClassTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform;
17 |
18 | import com.github.drinkjava2.asm.ClassVisitor;
19 | import com.github.drinkjava2.asm.Opcodes;
20 |
21 | abstract public class AbstractClassTransformer extends ClassTransformer {
22 | protected AbstractClassTransformer() {
23 | super(Opcodes.ASM5);
24 | }
25 |
26 | public void setTarget(ClassVisitor target) {
27 | cv = target;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/ClassEmitterTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform;
17 |
18 | import com.github.drinkjava2.cglib.core.ClassEmitter;
19 |
20 | abstract public class ClassEmitterTransformer extends ClassEmitter {
21 | }
22 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/ClassFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 |
17 | package com.github.drinkjava2.cglib.transform;
18 |
19 | /**
20 | *
21 | * @author baliuka
22 | */
23 | public interface ClassFilter {
24 |
25 | boolean accept(String className);
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/ClassFilterTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003,2004 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform;
17 |
18 | public class ClassFilterTransformer extends AbstractClassFilterTransformer {
19 | private ClassFilter filter;
20 |
21 | public ClassFilterTransformer(ClassFilter filter, ClassTransformer pass) {
22 | super(pass);
23 | this.filter = filter;
24 | }
25 |
26 | protected boolean accept(int version, int access, String name, String signature, String superName, String[] interfaces) {
27 | return filter.accept(name.replace('/', '.'));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/ClassTransformer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform;
17 |
18 | import com.github.drinkjava2.asm.ClassVisitor;
19 | import com.github.drinkjava2.asm.Opcodes;
20 |
21 | public abstract class ClassTransformer extends ClassVisitor {
22 | public ClassTransformer() {
23 | super(Opcodes.ASM5);
24 | }
25 | public ClassTransformer(int opcode) {
26 | super(opcode);
27 | }
28 | public abstract void setTarget(ClassVisitor target);
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/ClassTransformerFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform;
17 |
18 | public interface ClassTransformerFactory {
19 | ClassTransformer newInstance();
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/ClassTransformerTee.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform;
17 |
18 | import com.github.drinkjava2.asm.ClassVisitor;
19 | import com.github.drinkjava2.asm.Opcodes;
20 |
21 | public class ClassTransformerTee extends ClassTransformer {
22 | private ClassVisitor branch;
23 |
24 | public ClassTransformerTee(ClassVisitor branch) {
25 | super(Opcodes.ASM5);
26 | this.branch = branch;
27 | }
28 |
29 | public void setTarget(ClassVisitor target) {
30 | cv = new ClassVisitorTee(branch, target);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/MethodFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform;
17 |
18 | public interface MethodFilter {
19 | // TODO: pass class name too?
20 | boolean accept(int access, String name, String desc, String signature, String[] exceptions);
21 | }
22 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/TransformingClassGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform;
17 |
18 | import com.github.drinkjava2.asm.ClassVisitor;
19 | import com.github.drinkjava2.cglib.core.ClassGenerator;
20 |
21 | public class TransformingClassGenerator implements ClassGenerator {
22 | private ClassGenerator gen;
23 | private ClassTransformer t;
24 |
25 | public TransformingClassGenerator(ClassGenerator gen, ClassTransformer t) {
26 | this.gen = gen;
27 | this.t = t;
28 | }
29 |
30 | public void generateClass(ClassVisitor v) throws Exception {
31 | t.setTarget(v);
32 | gen.generateClass(t);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/TransformingClassLoader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform;
17 |
18 | import com.github.drinkjava2.asm.ClassReader;
19 | import com.github.drinkjava2.cglib.core.ClassGenerator;
20 |
21 | public class TransformingClassLoader extends AbstractClassLoader {
22 | private ClassTransformerFactory t;
23 |
24 | public TransformingClassLoader(ClassLoader parent, ClassFilter filter, ClassTransformerFactory t) {
25 | super(parent, parent, filter);
26 | this.t = t;
27 | }
28 |
29 | protected ClassGenerator getGenerator(ClassReader r) {
30 | ClassTransformer t2 = (ClassTransformer)t.newInstance();
31 | return new TransformingClassGenerator(super.getGenerator(r), t2);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/impl/FieldProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform.impl;
17 | @SuppressWarnings({"rawtypes" })
18 | public interface FieldProvider {
19 |
20 | String[] getFieldNames();
21 |
22 | Class[] getFieldTypes();
23 |
24 | void setField(int index, Object value);
25 |
26 | Object getField(int index);
27 |
28 |
29 | void setField(String name, Object value);
30 |
31 | Object getField(String name);
32 |
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/impl/InterceptFieldEnabled.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform.impl;
17 |
18 | public interface InterceptFieldEnabled {
19 | void setInterceptFieldCallback(InterceptFieldCallback callback);
20 | InterceptFieldCallback getInterceptFieldCallback();
21 | }
22 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/cglib/transform/impl/InterceptFieldFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2003 The Apache Software Foundation
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 com.github.drinkjava2.cglib.transform.impl;
17 |
18 | import com.github.drinkjava2.asm.Type;
19 |
20 | public interface InterceptFieldFilter {
21 | boolean acceptRead(Type owner, String name);
22 | boolean acceptWrite(Type owner, String name);
23 | }
24 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jbeanbox/EMPTY.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | * use this file except in compliance with the License. You may obtain a copy of
4 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
5 | * applicable law or agreed to in writing, software distributed under the
6 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
7 | * OF ANY KIND, either express or implied. See the License for the specific
8 | * language governing permissions and limitations under the License.
9 | */
10 | package com.github.drinkjava2.jbeanbox;
11 |
12 | /**
13 | * EMPTY used to mark a EMPTY value
14 | *
15 | * @author Yong Zhu
16 | * @since 2.4.8
17 | *
18 | */
19 | public final class EMPTY {// NOSONAR
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jbeanbox/PrototypeBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | * use this file except in compliance with the License. You may obtain a copy of
4 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
5 | * applicable law or agreed to in writing, software distributed under the
6 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
7 | * OF ANY KIND, either express or implied. See the License for the specific
8 | * language governing permissions and limitations under the License.
9 | */
10 | package com.github.drinkjava2.jbeanbox;
11 |
12 | /** Subclass implemented this interface will create prototype bean */
13 | public interface PrototypeBean {// NOSONAR
14 | }
15 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jbeanbox/annotation/COMPONENT.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | * use this file except in compliance with the License. You may obtain a copy of
4 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
5 | * applicable law or agreed to in writing, software distributed under the
6 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
7 | * OF ANY KIND, either express or implied. See the License for the specific
8 | * language governing permissions and limitations under the License.
9 | */
10 | package com.github.drinkjava2.jbeanbox.annotation;
11 |
12 | import java.lang.annotation.ElementType;
13 | import java.lang.annotation.Retention;
14 | import java.lang.annotation.RetentionPolicy;
15 | import java.lang.annotation.Target;
16 |
17 | /**
18 | * @COMPONENT used to mark a component, similar like @Component
19 | * annotation in Spring
20 | *
21 | * @author Yong Zhu
22 | * @since 2.5.0
23 | */
24 | @Retention(RetentionPolicy.RUNTIME)
25 | @Target(ElementType.TYPE)
26 | public @interface COMPONENT {
27 | /** If not empty, the value is the bean name */
28 | String value() default "";
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jbeanbox/annotation/NAMED.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | * use this file except in compliance with the License. You may obtain a copy of
4 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
5 | * applicable law or agreed to in writing, software distributed under the
6 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
7 | * OF ANY KIND, either express or implied. See the License for the specific
8 | * language governing permissions and limitations under the License.
9 | */
10 | package com.github.drinkjava2.jbeanbox.annotation;
11 |
12 | import java.lang.annotation.ElementType;
13 | import java.lang.annotation.Retention;
14 | import java.lang.annotation.RetentionPolicy;
15 | import java.lang.annotation.Target;
16 |
17 | /**
18 | * @NAMED similar like JSR330's @Named annotation
19 | *
20 | * @author Yong Zhu
21 | * @since 2.4.7
22 | *
23 | */
24 | @QUALIFILER
25 | @Retention(RetentionPolicy.RUNTIME)
26 | @Target({ ElementType.TYPE, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PARAMETER })
27 | public @interface NAMED {
28 | public String value() default "";
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jbeanbox/annotation/POSTCONSTRUCT.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | * use this file except in compliance with the License. You may obtain a copy of
4 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
5 | * applicable law or agreed to in writing, software distributed under the
6 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
7 | * OF ANY KIND, either express or implied. See the License for the specific
8 | * language governing permissions and limitations under the License.
9 | */
10 | package com.github.drinkjava2.jbeanbox.annotation;
11 |
12 | import static java.lang.annotation.ElementType.METHOD;
13 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
14 |
15 | import java.lang.annotation.Documented;
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.Target;
18 |
19 | /**
20 | * The POSTCONSTRUCT annotation is used on a method that needs to be executed
21 | * after dependency injection is done to perform any initialization.
22 | */
23 | @Documented
24 | @Retention(RUNTIME)
25 | @Target(METHOD)
26 | public @interface POSTCONSTRUCT {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jbeanbox/annotation/PREDESTROY.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | * use this file except in compliance with the License. You may obtain a copy of
4 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
5 | * applicable law or agreed to in writing, software distributed under the
6 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
7 | * OF ANY KIND, either express or implied. See the License for the specific
8 | * language governing permissions and limitations under the License.
9 | */
10 | package com.github.drinkjava2.jbeanbox.annotation;
11 |
12 | import static java.lang.annotation.ElementType.METHOD;
13 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
14 |
15 | import java.lang.annotation.Documented;
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.Target;
18 |
19 | /**
20 | * The PREDESTROY annotation is used on methods as a callback notification to
21 | * signal that the instance is in the process of being removed by the container.
22 | * The method annotated with PreDestroy is typically used to release resources
23 | * that it has been holding.
24 | */
25 |
26 | @Documented
27 | @Retention(RUNTIME)
28 | @Target(METHOD)
29 | public @interface PREDESTROY {
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jbeanbox/annotation/PROTOTYPE.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | * use this file except in compliance with the License. You may obtain a copy of
4 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
5 | * applicable law or agreed to in writing, software distributed under the
6 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
7 | * OF ANY KIND, either express or implied. See the License for the specific
8 | * language governing permissions and limitations under the License.
9 | */
10 | package com.github.drinkjava2.jbeanbox.annotation;
11 |
12 | import java.lang.annotation.ElementType;
13 | import java.lang.annotation.Retention;
14 | import java.lang.annotation.RetentionPolicy;
15 | import java.lang.annotation.Target;
16 |
17 | /**
18 | * Mark a bean is prototype, not singleton, it means each time will build a new
19 | * instance.
20 | *
21 | * @author Yong Zhu
22 | * @since 2.4
23 | *
24 | */
25 | @Retention(RetentionPolicy.RUNTIME)
26 | @Target({ ElementType.TYPE })
27 | public @interface PROTOTYPE {
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jbeanbox/annotation/QUALIFILER.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | * use this file except in compliance with the License. You may obtain a copy of
4 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
5 | * applicable law or agreed to in writing, software distributed under the
6 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
7 | * OF ANY KIND, either express or implied. See the License for the specific
8 | * language governing permissions and limitations under the License.
9 | */
10 | package com.github.drinkjava2.jbeanbox.annotation;
11 |
12 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
13 |
14 | import java.lang.annotation.ElementType;
15 | import java.lang.annotation.Retention;
16 | import java.lang.annotation.RetentionPolicy;
17 | import java.lang.annotation.Target;
18 |
19 | /**
20 | * QUALIFILER similar like jsr330's Qualifiler
21 | *
22 | * @author Yong Zhu
23 | * @since 2.4.7
24 | *
25 | */
26 | @Retention(RetentionPolicy.RUNTIME)
27 | @Target({ ANNOTATION_TYPE, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PARAMETER })
28 | public @interface QUALIFILER {
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jbeanbox/annotation/VALUE.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | * use this file except in compliance with the License. You may obtain a copy of
4 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
5 | * applicable law or agreed to in writing, software distributed under the
6 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
7 | * OF ANY KIND, either express or implied. See the License for the specific
8 | * language governing permissions and limitations under the License.
9 | */
10 | package com.github.drinkjava2.jbeanbox.annotation;
11 |
12 | import java.lang.annotation.ElementType;
13 | import java.lang.annotation.Retention;
14 | import java.lang.annotation.RetentionPolicy;
15 | import java.lang.annotation.Target;
16 |
17 | /**
18 | * VALUE for inject a String String or primative value, similar like Spring's
19 | * Value annotation, current version jBeanBox does not read values from property
20 | * file, to do that need use BeanBoxContext's setValueTranslator method to
21 | * customize the value transalator
22 | *
23 | * @author Yong Zhu
24 | * @since 2.4.7
25 | *
26 | */
27 | @Retention(RetentionPolicy.RUNTIME)
28 | @Target({ ElementType.FIELD, ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PARAMETER })
29 | public @interface VALUE {
30 | public String value();
31 | }
32 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdbpro/CustomizedSqlItem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
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 com.github.drinkjava2.jdbpro;
17 |
18 | /**
19 | * Sql Operation Type
20 | *
21 | * @author Yong Zhu
22 | * @since 1.7.0.3
23 | */
24 | public interface CustomizedSqlItem {
25 | /**
26 | * Prepare special SQL items
27 | *
28 | * @param ps
29 | * PreparedSQL instance
30 | */
31 | public void doPrepare(PreparedSQL ps);
32 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdbpro/JDBPRO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * 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, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 | package com.github.drinkjava2.jdbpro;
17 |
18 | /**
19 | * JDBPRO is deprecated from 5.xx version and may be deleted in future version,
20 | * Keep this this class is for compatible purpose only
21 | *
22 | * @deprecated use DB instead
23 | * @author Yong Zhu
24 | */
25 | @Deprecated
26 | public abstract class JDBPRO {//NOSONAR
27 | // do not change this file
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdbpro/LinkArrayList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * 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, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 | package com.github.drinkjava2.jdbpro;
17 |
18 | import java.util.ArrayList;
19 |
20 | /**
21 | * LinkArrayList make ArrayList support link style
22 | *
23 | * @author Yong Zhu
24 | * @since 2.0.0
25 | */
26 |
27 | @SuppressWarnings("serial")
28 | public class LinkArrayList
18 | * Usage:
19 | * DbContext db=new DbContext(ds);
20 | * db.tx(new TxBody(){
21 | * public void run(){
22 | * new User().setName("Tom").insert();
23 | * db.iExecute("delete from order where userId=?",param("Sam"));
24 | * }});
25 | *
26 | * or
27 | *
28 | * boolean result=db.tryTx(()->{new User().setName("Tom").insert();
29 | * db.iExecute("delete from order where userId=?",param("Sam"));
30 | * });
31 | *
32 | *
33 | */
34 | public interface TxBody {
35 | public void run();
36 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdbpro/handler/PaginHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdbpro.handler;
13 |
14 | import com.github.drinkjava2.jdbpro.DefaultOrderSqlHandler;
15 | import com.github.drinkjava2.jdbpro.ImprovedQueryRunner;
16 | import com.github.drinkjava2.jdbpro.PreparedSQL;
17 |
18 | /**
19 | * PaginHandler is a SqlHandler used to translate SQL to paginated SQL
20 | *
21 | * @author Yong Zhu
22 | * @since 1.0.0
23 | */
24 | public class PaginHandler extends DefaultOrderSqlHandler {
25 | int pageNumber;
26 | int pageSize;
27 |
28 | public PaginHandler(int pageNumber, int pageSize) {
29 | this.pageNumber = pageNumber;
30 | this.pageSize = pageSize;
31 | }
32 |
33 | @Override
34 | public void beforeExecute(ImprovedQueryRunner runner, PreparedSQL ps) {
35 | ps.setSql(runner.getDialect().pagin(pageNumber, pageSize, ps.getSql()));
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/PackageInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects;
13 |
14 | /**
15 | * jDialect is a separate project has its own Maven central releases.
16 | */
17 | public class PackageInfo {// NOSONAR
18 |
19 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/AutoId.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
15 | import static java.lang.annotation.ElementType.FIELD;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * A shortcut annotation equal to @GenertedValue(strategy=GenerationType.AUTO)
22 | */
23 | @Target(FIELD)
24 | @Retention(RUNTIME)
25 | public @interface AutoId {
26 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/CreateTimestamp.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.ElementType.FIELD;
15 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * Mark a CreateTimestamp column, explained by ORM tool
22 | *
23 | * @author Yong Zhu
24 | * @since 4.0.2
25 | */
26 | @Target({ FIELD })
27 | @Retention(RUNTIME)
28 |
29 | public @interface CreateTimestamp {
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/CreatedBy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.ElementType.FIELD;
15 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * Mark a CreatedBy column, explained by ORM tool
22 | *
23 | * @author Yong Zhu
24 | * @since 4.0.2
25 | */
26 | @Target({ FIELD })
27 | @Retention(RUNTIME)
28 |
29 | public @interface CreatedBy {
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/IdentityId.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
15 | import static java.lang.annotation.ElementType.FIELD;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * A shortcut annotation equal to
22 | * @GenertedValue(strategy=GenerationType.IDENTITY)
23 | */
24 | @Target(FIELD)
25 | @Retention(RUNTIME)
26 | public @interface IdentityId {
27 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/LastModifiedBy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.ElementType.FIELD;
15 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * Mark a LastModifiedBy column, explained by ORM tool
22 | *
23 | * @author Yong Zhu
24 | * @since 4.0.2
25 | */
26 | @Target({ FIELD })
27 | @Retention(RUNTIME)
28 |
29 | public @interface LastModifiedBy {
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/ShardDatabase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.ElementType.FIELD;
15 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.Target;
18 |
19 | /**
20 | * To mark this column is a ShardDatabase column, one table only allow 1 column
21 | * be marked as ShardDatabase column
22 | *
23 | * @author Yong Zhu
24 | * @since 1.0.5
25 | */
26 |
27 | @Target(FIELD)
28 | @Retention(RUNTIME)
29 | public @interface ShardDatabase {
30 | String[] value();
31 | }
32 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/ShardTable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.ElementType.FIELD;
15 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.Target;
18 |
19 | /**
20 | * To mark this column is a shardTable column, one table only allow 1 column be
21 | * marked as shardiTable column
22 | *
23 | * @author Yong Zhu
24 | * @since 1.0.5
25 | */
26 |
27 | @Target(FIELD)
28 | @Retention(RUNTIME)
29 | public @interface ShardTable {
30 | String[] value();
31 | }
32 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/SingleIndex.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.ElementType.FIELD;
15 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.Target;
18 |
19 | /**
20 | * A shortcut annotation of Index, only for one column
21 | */
22 | @Target(FIELD)
23 | @Retention(RUNTIME)
24 | public @interface SingleIndex {
25 |
26 | /**
27 | * (Optional) The name of the index; defaults to a provider-generated name.
28 | */
29 | String name() default "";
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/SingleUnique.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.ElementType.FIELD;
15 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.Target;
18 |
19 |
20 | /**
21 | * A shortcut annotation of Unique, only for one column
22 | *
23 | * @author Yong Zhu
24 | * @since 1.0.5
25 | */
26 |
27 | @Target(FIELD)
28 | @Retention(RUNTIME)
29 | public @interface SingleUnique {
30 |
31 | /**
32 | * (Optional) The name of the index; defaults to a provider-generated name.
33 | */
34 | String name() default "";
35 | }
36 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/TimeStampId.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
15 | import static java.lang.annotation.ElementType.FIELD;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * A shortcut annotation equal to @GenertedValue(strategy=GenerationType.TIMESTAMP_ID)
22 | */
23 | @Target(FIELD)
24 | @Retention(RUNTIME)
25 | public @interface TimeStampId {
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/UUID.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
15 | import static java.lang.annotation.ElementType.FIELD;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * A shortcut annotation equal to @GenertedValue(strategy=GenerationType.UUID)
22 | */
23 | @Target(FIELD)
24 | @Retention(RUNTIME)
25 | public @interface UUID {
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/UUID25.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
15 | import static java.lang.annotation.ElementType.FIELD;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * A shortcut annotation equal to @GenertedValue(strategy=GenerationType.UUID25)
22 | */
23 | @Target(FIELD)
24 | @Retention(RUNTIME)
25 | public @interface UUID25 {
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/UUID26.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
15 | import static java.lang.annotation.ElementType.FIELD;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * A shortcut annotation equal to @GenertedValue(strategy=GenerationType.UUID26)
22 | */
23 | @Target(FIELD)
24 | @Retention(RUNTIME)
25 | public @interface UUID26 {
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/UUID32.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
15 | import static java.lang.annotation.ElementType.FIELD;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * A shortcut annotation equal to @GenertedValue(strategy=GenerationType.UUID32)
22 | */
23 | @Target(FIELD)
24 | @Retention(RUNTIME)
25 | public @interface UUID32 {
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/UUID36.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
15 | import static java.lang.annotation.ElementType.FIELD;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * A shortcut annotation equal to @GenertedValue(strategy=GenerationType.UUID36)
22 | */
23 | @Target(FIELD)
24 | @Retention(RUNTIME)
25 | public @interface UUID36 {
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jdia/UpdateTimestamp.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jdialects.annotation.jdia;
13 |
14 | import static java.lang.annotation.ElementType.FIELD;
15 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
16 |
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * Mark a UpdateTimestamp column, explained by ORM tool
22 | *
23 | * @author Yong Zhu
24 | * @since 4.0.2
25 | */
26 | @Target({ FIELD })
27 | @Retention(RUNTIME)
28 |
29 | public @interface UpdateTimestamp {
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jpa/EnumType.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
6 | * which accompanies this distribution.
7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
8 | * and the Eclipse Distribution License is available at
9 | * http://www.eclipse.org/org/documents/edl-v10.php.
10 | *
11 | * Contributors:
12 | * Linda DeMichiel - Java Persistence 2.1
13 | * Linda DeMichiel - Java Persistence 2.0
14 | *
15 | ******************************************************************************/
16 | package com.github.drinkjava2.jdialects.annotation.jpa;
17 |
18 | /**
19 | * Defines mapping for enumerated types. The constants of this
20 | * enumerated type specify how a persistent property or
21 | * field of an enumerated type should be persisted.
22 | *
23 | * @since Java Persistence 1.0
24 | */
25 | public enum EnumType {
26 | /** Persist enumerated type property or field as an integer. */
27 | ORDINAL,
28 |
29 | /** Persist enumerated type property or field as a string. */
30 | STRING
31 | }
32 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/annotation/jpa/TemporalType.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
6 | * which accompanies this distribution.
7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
8 | * and the Eclipse Distribution License is available at
9 | * http://www.eclipse.org/org/documents/edl-v10.php.
10 | *
11 | * Contributors:
12 | * Linda DeMichiel - Java Persistence 2.1
13 | * Linda DeMichiel - Java Persistence 2.0
14 | *
15 | ******************************************************************************/
16 | package com.github.drinkjava2.jdialects.annotation.jpa;
17 |
18 | /**
19 | * Type used to indicate a specific mapping of java.util.Date
20 | * or java.util.Calendar
.
21 | *
22 | * @since Java Persistence 1.0
23 | */
24 | public enum TemporalType {
25 |
26 | /** Map as java.sql.Date
*/
27 | DATE,
28 |
29 | /** Map as java.sql.Time
*/
30 | TIME,
31 |
32 | /** Map as java.sql.Timestamp
*/
33 | TIMESTAMP
34 | }
35 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/converter/BasicJdbcToJavaConverter.java:
--------------------------------------------------------------------------------
1 | package com.github.drinkjava2.jdialects.converter;
2 |
3 | public class BasicJdbcToJavaConverter implements JdbcToJavaConverter {
4 | public static final BasicJdbcToJavaConverter instance = new BasicJdbcToJavaConverter();
5 |
6 | @Override
7 | public Object convert(Object value) {
8 | return value;
9 | }
10 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/converter/JavaConverter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * 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, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 | package com.github.drinkjava2.jdialects.converter;
17 |
18 | /**
19 | * JdbcTypeConverter, used to conver jdbc value to java, or java value to jdbc
20 | * parameter for SQL
21 | *
22 | * @author yongz
23 | * @since 5.0.0
24 | *
25 | */
26 | public interface JavaConverter {
27 |
28 | /**
29 | * Convert java value to targetType java value
30 | * @param value
31 | * @param targetType
32 | * @return new value
33 | */
34 | public Object convert(Object value, Class> targetType);
35 |
36 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/converter/JavaToJdbcConverter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * 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, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 | package com.github.drinkjava2.jdialects.converter;
17 |
18 | /**
19 | * JavaToJdbcConverter used to convert Java value to JDBC value
20 | *
21 | * @author yongz
22 | * @since 5.0.0
23 | *
24 | */
25 | public interface JavaToJdbcConverter {
26 |
27 | /** Convert Java value to JDBC value */
28 | public Object convert(Object value);
29 |
30 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/converter/JdbcToJavaConverter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * 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, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 | package com.github.drinkjava2.jdialects.converter;
17 |
18 | /**
19 | * JdbcToJavaConverter used to convert jdbc value to java value
20 | *
21 | * @author yongz
22 | * @since 5.0.0
23 | *
24 | */
25 | public interface JdbcToJavaConverter {
26 |
27 | /** Convert jdbc value to java value */
28 | public Object convert(Object value);
29 |
30 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jdialects/springsrc/PackageInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * 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, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 |
17 | package com.github.drinkjava2.jdialects.springsrc;
18 |
19 | /**
20 | * All .java files in this folder are copied from Spring4.3.9.Release, no any
21 | * change except the package name
22 | *
23 | * @author Yong Zhu
24 | * @since 1.7.0
25 | */
26 | public abstract class PackageInfo {
27 | }
28 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jlogs/EmptyLog.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * 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, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations under
14 | * the License.
15 | */
16 | package com.github.drinkjava2.jlogs;
17 |
18 | /**
19 | * EmptyLog is an empty implementation of Log
20 | *
21 | * @author Yong Zhu
22 | * @since 1.7.0
23 | */
24 | @SuppressWarnings("all")
25 | public class EmptyLog implements Log {
26 |
27 | public EmptyLog(Class> clazz) {
28 | }
29 |
30 | @Override
31 | public void info(String msg) {
32 | }
33 |
34 | @Override
35 | public void warn(String msg) {
36 | }
37 |
38 | @Override
39 | public void warn(String msg, Throwable t) {
40 | }
41 |
42 | @Override
43 | public void error(String msg) {
44 |
45 | }
46 |
47 | @Override
48 | public void error(String msg, Throwable t) {
49 | }
50 |
51 | @Override
52 | public void debug(String msg) {
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jsqlbox/EntityType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jsqlbox;
13 |
14 | /**
15 | * EntityType means a standard Java Bean be mapped to a database table
16 | *
17 | * @author Yong Zhu
18 | * @since 2.0.4
19 | */
20 | public interface EntityType {
21 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jsqlbox/JSQLBOX.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jsqlbox;
13 |
14 | /**
15 | * JSQLBOX is deprecated from 4.xx version and may be deleted in future version,
16 | * Keep this this class is for compatible purpose only
17 | *
18 | * @deprecated use DB instead
19 | *
20 | * @author Yong Zhu
21 | * @since 1.0.8
22 | */
23 | @Deprecated
24 | public abstract class JSQLBOX extends DB {// NOSONAR
25 | // do not change this file
26 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jsqlbox/SqlBoxContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jsqlbox;
13 |
14 | import javax.sql.DataSource;
15 |
16 | import com.github.drinkjava2.jdialects.Dialect;
17 |
18 | /**
19 | * SqlBoxContext is extended from DbContext
20 | *
21 | * @author Yong Zhu
22 | * @since 1.0.0
23 | * @Deprecated From V4.0 Suggest use DbContext
24 | */
25 | @Deprecated
26 | public class SqlBoxContext extends DbContext {//NOSONAR
27 | public SqlBoxContext() {
28 | super();
29 | }
30 |
31 | public SqlBoxContext(DataSource ds) {
32 | super(ds);
33 | }
34 |
35 | public SqlBoxContext(DataSource ds, Dialect dialect) {
36 | super(ds, dialect);
37 | }
38 |
39 | public static void setGlobalSqlBoxContext(DbContext dc) {
40 | DbContext.setGlobalDbContext(dc);
41 | }
42 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/github/drinkjava2/jsqlbox/Tail.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | * use this file except in compliance with the License. You may obtain a copy of
6 | * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
7 | * applicable law or agreed to in writing, software distributed under the
8 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9 | * OF ANY KIND, either express or implied. See the License for the specific
10 | * language governing permissions and limitations under the License.
11 | */
12 | package com.github.drinkjava2.jsqlbox;
13 |
14 | /**
15 | * Tail is an empty entity only used to deal tables no any entity mapping, so
16 | * each CURD need add a tail("table") as parameter, for example:
17 | *
18 | * new Tail().putTail("user_name", "Tom", "age", 10).insert(JSQLBOX.tail("some_table"));
19 | *
20 | * @author Yong Zhu
21 | * @since 2.0.4
22 | */
23 | public class Tail extends ActiveRecord
29 | * public class Car {
30 | * @Inject @Named("driver") Seat driverSeat;
31 | * @Inject @Named("passenger") Seat passengerSeat;
32 | * ...
33 | * }
34 | */
35 | @Qualifier
36 | @Documented
37 | @Retention(RUNTIME)
38 | public @interface Named {
39 |
40 | /** The name. */
41 | String value() default "";
42 | }
43 |
--------------------------------------------------------------------------------
/core/src/main/java/javax/inject/Singleton.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2009 The JSR-330 Expert Group
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 |
17 | package javax.inject;
18 |
19 | import java.lang.annotation.Documented;
20 | import java.lang.annotation.Retention;
21 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
22 |
23 | /**
24 | * Identifies a type that the injector only instantiates once. Not inherited.
25 | *
26 | * @see javax.inject.Scope @Scope
27 | */
28 | @Scope
29 | @Documented
30 | @Retention(RUNTIME)
31 | public @interface Singleton {}
32 |
--------------------------------------------------------------------------------
/core/src/main/java/org/aopalliance/aop/Advice.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-2016 the original author or authors.
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 |
17 | package org.aopalliance.aop;
18 |
19 | /**
20 | * Tag interface for Advice. Implementations can be any type
21 | * of advice, such as Interceptors.
22 | *
23 | * @author Rod Johnson
24 | * @version $Id: Advice.java,v 1.1 2004/03/19 17:02:16 johnsonr Exp $
25 | */
26 | public interface Advice {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/main/java/org/aopalliance/intercept/ConstructorInvocation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2002-2016 the original author or authors.
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 |
17 | package org.aopalliance.intercept;
18 |
19 | import java.lang.reflect.Constructor;
20 |
21 | /**
22 | * Description of an invocation to a constuctor, given to an
23 | * interceptor upon constructor-call.
24 | *
25 | *