├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── LICENSE ├── brief-common ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── javaoffers │ │ └── brief │ │ └── modelhelper │ │ ├── anno │ │ ├── BaseModel.java │ │ ├── BaseUnique.java │ │ ├── ColName.java │ │ ├── EnumValue.java │ │ ├── NoneCol.java │ │ ├── derive │ │ │ ├── Blur.java │ │ │ ├── EmailBlur.java │ │ │ ├── IdCardBlur.java │ │ │ ├── JsonColumn.java │ │ │ ├── PhoneNumBlur.java │ │ │ ├── StringBlur.java │ │ │ └── flag │ │ │ │ ├── DeriveFlag.java │ │ │ │ ├── DeriveInfo.java │ │ │ │ ├── DeriveMark.java │ │ │ │ ├── IsDel.java │ │ │ │ ├── NormalDeriveInfo.java │ │ │ │ ├── RowStatus.java │ │ │ │ ├── ShardingStrategyMark.java │ │ │ │ └── Version.java │ │ ├── fun │ │ │ ├── noneparam │ │ │ │ ├── math │ │ │ │ │ └── Rand.java │ │ │ │ └── time │ │ │ │ │ ├── Curdate.java │ │ │ │ │ ├── CurrentDate.java │ │ │ │ │ ├── CurrentTime.java │ │ │ │ │ ├── Curtime.java │ │ │ │ │ ├── Now.java │ │ │ │ │ └── UnixTimestamp.java │ │ │ ├── params │ │ │ │ ├── CaseWhen.java │ │ │ │ ├── If.java │ │ │ │ ├── IfEq.java │ │ │ │ ├── IfGt.java │ │ │ │ ├── IfGte.java │ │ │ │ ├── IfLt.java │ │ │ │ ├── IfLte.java │ │ │ │ ├── IfNeq.java │ │ │ │ ├── IfNotNull.java │ │ │ │ ├── IfNull.java │ │ │ │ ├── Left.java │ │ │ │ ├── Right.java │ │ │ │ ├── math │ │ │ │ │ ├── Abs.java │ │ │ │ │ ├── Ceil.java │ │ │ │ │ ├── Floor.java │ │ │ │ │ ├── Mod.java │ │ │ │ │ ├── Round.java │ │ │ │ │ └── Truncate.java │ │ │ │ ├── time │ │ │ │ │ ├── DateFormat.java │ │ │ │ │ ├── Dayname.java │ │ │ │ │ ├── FromDays.java │ │ │ │ │ ├── Hour.java │ │ │ │ │ ├── Makedate.java │ │ │ │ │ ├── Maketime.java │ │ │ │ │ ├── Minute.java │ │ │ │ │ ├── Month.java │ │ │ │ │ ├── Monthname.java │ │ │ │ │ ├── SecToTime.java │ │ │ │ │ ├── StrToDate.java │ │ │ │ │ ├── TimeFormat.java │ │ │ │ │ ├── TimeToSec.java │ │ │ │ │ ├── ToDays.java │ │ │ │ │ ├── Week.java │ │ │ │ │ ├── Weekday.java │ │ │ │ │ └── Year.java │ │ │ │ └── varchar │ │ │ │ │ ├── CharLength.java │ │ │ │ │ ├── Concat.java │ │ │ │ │ ├── ConcatWs.java │ │ │ │ │ ├── GroupConcat.java │ │ │ │ │ ├── LTrim.java │ │ │ │ │ ├── Length.java │ │ │ │ │ ├── Lower.java │ │ │ │ │ ├── RTrim.java │ │ │ │ │ ├── Repeat.java │ │ │ │ │ ├── Replace.java │ │ │ │ │ ├── Strcmp.java │ │ │ │ │ ├── SubString.java │ │ │ │ │ ├── Trim.java │ │ │ │ │ └── Upper.java │ │ │ └── parse │ │ │ │ ├── FunAnnoParser.java │ │ │ │ └── ParseSqlFunResult.java │ │ └── internal │ │ │ └── NotNull.java │ │ ├── briefstate │ │ └── BriefCommonComponentStates.java │ │ ├── constants │ │ ├── ConfigPropertiesConstants.java │ │ └── ModelHelpperConstants.java │ │ ├── context │ │ ├── BriefContext.java │ │ ├── BriefContextAware.java │ │ ├── BriefContextPostProcessor.java │ │ ├── BriefProperties.java │ │ ├── BriefPropertiesLoader.java │ │ ├── ConditionInterceptor.java │ │ ├── DeriveInfoLoader.java │ │ ├── Interceptor.java │ │ ├── JqlInterceptor.java │ │ └── JqlInterceptorLoader.java │ │ ├── core │ │ ├── BaseSQLInfo.java │ │ ├── BaseSQLStatement.java │ │ ├── ConvertProxy.java │ │ ├── Id.java │ │ ├── KeyGenerate.java │ │ ├── Limit.java │ │ ├── UniqueKeyGenerate.java │ │ └── gkey │ │ │ ├── AtoIncrementSequenceKey.java │ │ │ ├── SnowflakeKey.java │ │ │ ├── UUIDKey.java │ │ │ └── VoidKey.java │ │ ├── exception │ │ ├── BaseException.java │ │ ├── BriefException.java │ │ ├── BriefTransactionException.java │ │ ├── ClassNotFindException.java │ │ ├── ConnectionException.java │ │ ├── EnumValueException.java │ │ ├── FindColException.java │ │ ├── GetColValueException.java │ │ ├── JdbcException.java │ │ ├── NewInstanceException.java │ │ ├── ParseDataSourceException.java │ │ ├── ParseModelException.java │ │ ├── ParseParamException.java │ │ ├── ParseResultSetException.java │ │ ├── ParseTableException.java │ │ ├── PrimaryKeyNotFoundException.java │ │ ├── QueryDataException.java │ │ ├── ShardingConfigExecException.java │ │ ├── SqlAesProcessException.java │ │ ├── SqlParseException.java │ │ ├── StopExecException.java │ │ └── UpdateFieldsException.java │ │ ├── filter │ │ ├── Filter.java │ │ ├── JqlExecutorChain.java │ │ ├── JqlExecutorFilter.java │ │ ├── JqlFunFilter.java │ │ ├── JqlMetaInfo.java │ │ └── impl │ │ │ └── AsSqlFunFilterImpl.java │ │ ├── fun │ │ ├── CategoryTag.java │ │ ├── Condition.java │ │ ├── ConditionContext.java │ │ ├── ConditionTag.java │ │ ├── ConstructorFun.java │ │ ├── G4GetterFun.java │ │ ├── G5GetterFun.java │ │ ├── GGGetterFun.java │ │ ├── GGetterFun.java │ │ ├── GetterFun.java │ │ └── ShardingCondition.java │ │ ├── jdbc │ │ ├── DataSourceExecutor.java │ │ ├── JdbcExecutor.java │ │ ├── JdbcExecutorFactory.java │ │ ├── JdbcExecutorMetadata.java │ │ ├── ModifyExecutor.java │ │ ├── QueryExecutor.java │ │ ├── ResultSetExecutor.java │ │ └── SaveExecutor.java │ │ ├── mapper │ │ └── BaseMapper.java │ │ ├── parser │ │ ├── MarkConditionParser.java │ │ ├── StatementParser.java │ │ └── TableInfoParser.java │ │ └── utils │ │ ├── Assert.java │ │ ├── BlurUtils.java │ │ ├── ByteBuddyUtils.java │ │ ├── CglibProxyProcess.java │ │ ├── CglibProxyUtils.java │ │ ├── ColNameAndColValueUtils.java │ │ ├── ColNameAnnoInfo.java │ │ ├── ColumnInfo.java │ │ ├── ColumnLabel.java │ │ ├── CommonExecutor.java │ │ ├── DBType.java │ │ ├── DBTypeLabel.java │ │ ├── DeriveProcessFire.java │ │ ├── EnumValueUtils.java │ │ ├── FieldNameAnnoInfo.java │ │ ├── FutureLock.java │ │ ├── Getter.java │ │ ├── GsonUtils.java │ │ ├── JdkProxyUtils.java │ │ ├── LambdaCreateUtils.java │ │ ├── Lists.java │ │ ├── ModelFieldInfo.java │ │ ├── ModelFieldInfoPosition.java │ │ ├── ModelInfo.java │ │ ├── NetUtils.java │ │ ├── Newc.java │ │ ├── ProxyProcess.java │ │ ├── ReflectionUtils.java │ │ ├── SQLType.java │ │ ├── Setter.java │ │ ├── SoftCache.java │ │ ├── SqlColInfo.java │ │ ├── TableHelper.java │ │ ├── TableInfo.java │ │ └── Utils.java │ └── resources │ └── log4j.properties ├── brief-core ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── javaoffers │ └── brief │ └── modelhelper │ ├── context │ ├── SmartBriefContext.java │ ├── SmartBriefProperties.java │ └── SmartTableInfoParser.java │ ├── core │ ├── BaseBrief.java │ ├── BaseBriefImpl.java │ ├── BaseBriefImplAdapter.java │ ├── CrudMapperConstant.java │ ├── CrudMapperMethodExcutor.java │ ├── CrudMapperMethodThreadLocal.java │ ├── CrudSQLStatement.java │ ├── LinkedConditions.java │ ├── MysqlStatementParser.java │ ├── SQL.java │ ├── SQLParse.java │ ├── SmartSQLInfo.java │ ├── StatementParserAdepter.java │ └── parse │ │ ├── AbstractParseCondition.java │ │ ├── DeleteConditionParse.java │ │ ├── InsertConditionParse.java │ │ ├── ParseCondition.java │ │ ├── SelectConditionParse.java │ │ └── UpdateConditionParse.java │ ├── filter │ ├── LastJqlChainFilter.java │ └── SmartJqlChainFilter.java │ ├── fun │ ├── AggTag.java │ ├── ExecutFun.java │ ├── ExecutMoreFun.java │ ├── ExecutOneFun.java │ ├── HeadCondition.java │ ├── HeadEnum.java │ ├── StreamingFun.java │ ├── condition │ │ ├── ColValueCondition.java │ │ ├── DeleteFromCondition.java │ │ ├── IgnoreAndOrWordCondition.java │ │ ├── JoinTableCondition.java │ │ ├── KeyWordCondition.java │ │ ├── insert │ │ │ ├── InsertAllColValueCondition.java │ │ │ ├── InsertCondition.java │ │ │ └── InsertIntoCondition.java │ │ ├── mark │ │ │ ├── OnConditionMark.java │ │ │ ├── OnDuplicateKeyUpdateMark.java │ │ │ ├── ReplaceIntoMark.java │ │ │ └── WhereConditionMark.java │ │ ├── on │ │ │ ├── OnColumnFunCondition.java │ │ │ └── OnValueFunCondition.java │ │ ├── select │ │ │ ├── SelectColumnCondition.java │ │ │ └── SelectTableCondition.java │ │ ├── update │ │ │ ├── UpdateAllColValueCondition.java │ │ │ ├── UpdateColValueCondition.java │ │ │ ├── UpdateCondition.java │ │ │ └── UpdateSetCondition.java │ │ └── where │ │ │ ├── AddPatchMarkCondition.java │ │ │ ├── BetweenCondition.java │ │ │ ├── CondSQLCondition.java │ │ │ ├── ExistsCondition.java │ │ │ ├── GroupByWordCondition.java │ │ │ ├── HavingBetweenCondition.java │ │ │ ├── HavingGroupCondition.java │ │ │ ├── HavingInCondition.java │ │ │ ├── HavingMarkWordCondition.java │ │ │ ├── InCondition.java │ │ │ ├── IsNullOrCondition.java │ │ │ ├── KeyWordCondition.java │ │ │ ├── LFCondition.java │ │ │ ├── LeftGroupByWordCondition.java │ │ │ ├── LikeCondition.java │ │ │ ├── LimitWordCondition.java │ │ │ ├── NativeSQLCondition.java │ │ │ ├── OrCondition.java │ │ │ ├── OrderWordCondition.java │ │ │ ├── RFWordCondition.java │ │ │ ├── WhereCondition.java │ │ │ └── WhereOnCondition.java │ ├── crud │ │ ├── BaseSelectFun.java │ │ ├── FirstOnFun.java │ │ ├── GroupFun.java │ │ ├── HavingFun.java │ │ ├── HavingPendingFun.java │ │ ├── JoinFun.java │ │ ├── JoinFunTableExtend.java │ │ ├── LastJoinFun.java │ │ ├── LastJoinFunTableExtend.java │ │ ├── LastOnFun.java │ │ ├── LeftGroupFun.java │ │ ├── LeftHavingPendingFun.java │ │ ├── LeftWhereSelectFun.java │ │ ├── LimitFun.java │ │ ├── OnFun.java │ │ ├── OrderFun.java │ │ ├── SelectFun.java │ │ ├── SmartJoinFun.java │ │ ├── SmartOnFun.java │ │ ├── SmartSelectFun.java │ │ ├── ToJoinFun.java │ │ ├── WhereFun.java │ │ ├── WhereModifyFun.java │ │ ├── WhereSelectFun.java │ │ ├── delete │ │ │ ├── DeleteFun.java │ │ │ └── DeleteWhereFun.java │ │ ├── impl │ │ │ ├── HavingFunImpl.java │ │ │ ├── HavingPendingFunImpl.java │ │ │ ├── JoinFunImpl.java │ │ │ ├── LastJoinFunImpl.java │ │ │ ├── LastLeftHavingFunImpl.java │ │ │ ├── LastLeftHavingPendingFunImpl.java │ │ │ ├── LastLeftWhereSelectFunImpl.java │ │ │ ├── LastOnFunImpl.java │ │ │ ├── LeftHavingFunImpl.java │ │ │ ├── LeftHavingPendingFunImpl.java │ │ │ ├── LeftWhereSelectFunImpl.java │ │ │ ├── OnFunImpl.java │ │ │ ├── SelectFunImpl.java │ │ │ ├── SmartSelectFunImpl.java │ │ │ ├── WhereSelectFunImpl.java │ │ │ ├── delete │ │ │ │ ├── DeleteFunImpl.java │ │ │ │ └── DeleteWhereFunImpl.java │ │ │ ├── insert │ │ │ │ ├── InsertFunImpl.java │ │ │ │ ├── MoreInsertFunImpl.java │ │ │ │ ├── OneInsertFunImpl.java │ │ │ │ └── SmartMoreInsertFunImpl.java │ │ │ └── update │ │ │ │ ├── OneUpdateFunImpl.java │ │ │ │ ├── PrepareWhereModifyFunImpl.java │ │ │ │ ├── SmartUpdateFunImpl.java │ │ │ │ ├── UpdateFunImpl.java │ │ │ │ └── WhereModifyFunImpl.java │ │ ├── insert │ │ │ ├── InsertFun.java │ │ │ ├── MoreInsertColAll.java │ │ │ ├── MoreInsertFun.java │ │ │ ├── OneInsertCol.java │ │ │ ├── OneInsertFun.java │ │ │ ├── SmartMoreInsertColAll.java │ │ │ └── SmartMoreInsertFun.java │ │ └── update │ │ │ ├── MoreUpdateFun.java │ │ │ ├── OneUpdateCol.java │ │ │ ├── OneUpdateFun.java │ │ │ ├── PrepareWhereModifyFun.java │ │ │ ├── SmartUpdateFun.java │ │ │ └── UpdateFun.java │ └── general │ │ ├── GeneralFun.java │ │ └── impl │ │ ├── GeneralFunImpl.java │ │ └── NativeFunImpl.java │ ├── jdbc │ ├── BriefJdbcExecutor.java │ ├── BriefJdbcExecutorFactory.java │ ├── BriefModifyExecutor.java │ ├── BriefQueryExecutor.java │ ├── BriefResultSetExecutor.java │ └── BriefSaveExecutor.java │ ├── log │ └── JqlLogger.java │ ├── mapper │ ├── BriefMapper.java │ └── SmartMapperProxy.java │ ├── parse │ ├── H2TableInfoParser.java │ └── MysqlTableInfoParser.java │ ├── readme.md │ └── utils │ └── BriefUtils.java ├── brief-encipher ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── javaoffers │ └── brief │ └── modelhelper │ └── encrypt │ ├── BriefEncipher.java │ ├── EncryptConfigConst.java │ ├── EncryptConfigContext.java │ ├── JqlAesInterceptor.java │ ├── JqlAesInterceptorImpl.java │ ├── SqlAesProcessor.java │ └── SqlAesProcessorImpl.java ├── brief-helper ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── javaoffers │ └── brief │ └── modelhelper │ ├── AppTest.java │ ├── consistant │ └── ModelConsistants.java │ ├── convert │ ├── AbstractConver.java │ ├── Boolean2StringConvert.java │ ├── ByteArray2JsonColumnConvert.java │ ├── ByteArray2StringConvert.java │ ├── Character2StringConvert.java │ ├── Convert.java │ ├── Date2LocalDateConvert.java │ ├── Date2LocalDateTimeConvert.java │ ├── Date2LongConvert.java │ ├── Date2OffsetDateTimeConvert.java │ ├── Date2StringConvert.java │ ├── DateOne2DateTwoConvert.java │ ├── LocalDate2StringConvert.java │ ├── LocalDateTime2DateConvert.java │ ├── LocalDateTime2StringConvert.java │ ├── Number2BooleanConvert.java │ ├── Number2DateConvert.java │ ├── Number2EnumConvert.java │ ├── Number2LocalDateConvert.java │ ├── Number2LocalDateTimeConvert.java │ ├── Number2PrimitiveConvert.java │ ├── Number2SQLDateConvert.java │ ├── Number2StringConvert.java │ ├── Number2VersionConvert.java │ ├── PrimitiveNumber2PrimitiveNumberConvert.java │ ├── Serializable2IdConvert.java │ ├── String2BigDecimalConvert.java │ ├── String2BigIntegerConvert.java │ ├── String2BooleanConvert.java │ ├── String2ByteConvert.java │ ├── String2CharConvert.java │ ├── String2DateConvert.java │ ├── String2DoubleConvert.java │ ├── String2EnumConvert.java │ ├── String2FloatConvert.java │ ├── String2IntegerConvert.java │ ├── String2JsonColumnConvert.java │ ├── String2LocalDateConvert.java │ ├── String2LocalDateTimeConvert.java │ ├── String2LongConvert.java │ ├── String2OffsetDateTimeConvert.java │ ├── String2SQLDateConvert.java │ └── String2ShortConvert.java │ ├── core │ ├── ConverDescriptor.java │ ├── ConvertDelegate.java │ ├── ConvertRegisterSelectorDelegate.java │ ├── Descriptor.java │ ├── ModelApplicationContext.java │ ├── Register.java │ ├── Selector.java │ └── SelectorRegister.java │ ├── parse │ ├── ModelParse.java │ ├── ModelParseUtils.java │ ├── RealtimeModelParse.java │ ├── RealtimeSmartModelParse.java │ └── SmartModelParse.java │ ├── readme.md │ └── util │ ├── DateUtils.java │ ├── HelperUtils.java │ └── Model.java ├── brief-samples ├── brief-commom-sample │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── javaoffers │ │ └── base │ │ └── modelhelper │ │ └── sample │ │ ├── blur │ │ └── BlurSample.java │ │ ├── common │ │ └── FunAnnoParserSample.java │ │ ├── constant │ │ ├── ManLevel.java │ │ ├── Month.java │ │ ├── Sex.java │ │ └── Work.java │ │ ├── gkey │ │ └── SnowflakeKeySample.java │ │ ├── json │ │ └── ExtraInfo.java │ │ ├── mapper │ │ ├── BriefEncryptDataMapper.java │ │ ├── BriefTeacherMapper.java │ │ ├── BriefUserMapper.java │ │ ├── BriefUserOrderMapper.java │ │ ├── EncryptDataAuMapper.java │ │ ├── ShardingUserMapper.java │ │ └── UserMapper.java │ │ ├── model │ │ ├── EncryptData.java │ │ ├── EncryptDataAutoUpdate.java │ │ ├── ShardingUser.java │ │ ├── Teacher.java │ │ ├── User.java │ │ ├── UserOrder.java │ │ ├── UserTeacher.java │ │ ├── ViewModel.java │ │ └── WithAsModel.java │ │ ├── sharding │ │ └── ShardingUserTableMonthStrategy.java │ │ └── utils │ │ └── LOGUtils.java ├── brief-mybatis-sample │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── javaoffers │ │ │ └── base │ │ │ └── modelhelper │ │ │ └── sample │ │ │ ├── HelpSample.java │ │ │ └── spring │ │ │ ├── SpringSuportCrudEncryptMapperEncryptData.java │ │ │ ├── SpringSuportCrudShardingMapperOp.java │ │ │ ├── SpringSuportCrudUserMapperBlur.java │ │ │ ├── SpringSuportCrudUserMapperDelete.java │ │ │ ├── SpringSuportCrudUserMapperGeneral.java │ │ │ ├── SpringSuportCrudUserMapperInsert.java │ │ │ ├── SpringSuportCrudUserMapperSelect.java │ │ │ ├── SpringSuportCrudUserMapperUpdate.java │ │ │ ├── SpringSuportUserMapper.java │ │ │ ├── SpringSupportCrudUserMapperAllOperation.java │ │ │ ├── config │ │ │ └── encrypt │ │ │ │ ├── AesEncryptConfigBeanRegistrar.java │ │ │ │ ├── MybatisEncryptInterceptor.java │ │ │ │ ├── MybatisEncryptInterceptorConfig.java │ │ │ │ └── anno │ │ │ │ ├── AesEncryptConfig.java │ │ │ │ └── EncryptTableColumns.java │ │ │ ├── filter │ │ │ └── JqlSampleFilter.java │ │ │ └── interceptor │ │ │ ├── LogInterceptor.java │ │ │ └── SpringSuportJqlInterceptor.java │ │ └── resources │ │ ├── application.yml │ │ ├── h2.sql │ │ ├── mysql.sql │ │ ├── sqlMapConfig.xml │ │ └── static │ │ └── model │ │ └── ReformMapper.xml_bak ├── brief-orms-sample │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── BriefSample.java │ │ ├── MybatisSample.java │ │ ├── TestStarter.java │ │ ├── brief │ │ │ ├── BriefInitializer.java │ │ │ └── entity │ │ │ │ └── BriefAccount.java │ │ ├── commons │ │ │ └── DataSourceFactory.java │ │ ├── flex │ │ │ ├── FlexInitializer.java │ │ │ ├── entity │ │ │ │ └── FlexAccount.java │ │ │ └── mapper │ │ │ │ └── FlexAccountMapper.java │ │ └── plus │ │ │ ├── PlusInitializer.java │ │ │ ├── entity │ │ │ └── PlusAccount.java │ │ │ └── mapper │ │ │ └── PlusAccountMapper.java │ │ └── resources │ │ ├── mybatis-flex.properties │ │ └── schema.sql ├── brief-speedier-sample │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── javaoffers │ │ │ └── base │ │ │ └── modelhelper │ │ │ └── sample │ │ │ ├── MockBriefJdbcExecutor.java │ │ │ ├── MockBriefJdbcExecutorFactory.java │ │ │ ├── MockBriefSpeedier.java │ │ │ ├── clickhouse │ │ │ ├── ClickHouseSample.java │ │ │ └── MyFirstTable.java │ │ │ ├── encipher │ │ │ └── SqlParserProcessorTest.java │ │ │ ├── mysql │ │ │ └── MysqlSample.java │ │ │ ├── oracle │ │ │ └── OracleSample.java │ │ │ ├── pgsql │ │ │ └── PgSqlSample.java │ │ │ ├── sharding │ │ │ └── ShardingSample.java │ │ │ ├── speedier │ │ │ └── BriefSpeedierSample.java │ │ │ ├── sqlite │ │ │ └── SqliteSample.java │ │ │ └── sqlserver │ │ │ └── SqlServerSample.java │ │ └── resources │ │ └── logback.xml └── pom.xml ├── brief-sharding ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── javaoffers │ └── brief │ └── modelhelper │ └── sharding │ ├── context │ ├── ConditionBriefContextPostProcessor.java │ └── ShardingStrategyContext.java │ ├── derive │ ├── ShardingDeriveInfo.java │ ├── ShardingDeriveInfoLoader.java │ ├── ShardingModifyJqlExecutorFilter.java │ ├── ShardingOrder.java │ ├── ShardingParams.java │ ├── ShardingProcessor.java │ ├── ShardingQueryJqlExecutorFilter.java │ ├── ShardingQueryParse.java │ ├── ShardingStrategy.java │ ├── ShardingTableMonthStrategy.java │ ├── ShardingTableProcessor.java │ └── ShardingTableStrategy.java │ └── exception │ └── ShardingConfigException.java ├── brief-speedier ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── javaoffers │ └── brief │ └── modelhelper │ └── speedier │ ├── BriefSpeedier.java │ ├── BriefSpeedierDataSource.java │ ├── SpeedierBriefContext.java │ ├── config │ └── BriefSpeedierConfigProperties.java │ └── transaction │ ├── BriefTransaction.java │ └── SpeedierTransactionManagement.java ├── brief-sqlstatement ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── javaoffers │ ├── brief │ └── modelhelper │ │ └── parser │ │ ├── ColNameProcessorInfo.java │ │ ├── ConditionName.java │ │ ├── NamingFromItemVisitorAdapter.java │ │ ├── NamingSelectContent.java │ │ ├── NamingSelectExpressionVisitorAdapter.java │ │ ├── NamingSelectItemVisitor.java │ │ ├── NamingSelectVisitorAdapter.java │ │ ├── NamingStatementVisitorAdapter.java │ │ ├── SqlParserProcessor.java │ │ ├── TableColumns.java │ │ ├── delete │ │ └── NamingDeleteExpressionVisitorAdapter.java │ │ ├── insert │ │ ├── NamingInsertExpressionVisitorAdapter.java │ │ ├── NamingInsertItemsListVisitorAdapter.java │ │ ├── NamingInsertSelectExpressionVisitorAdapter.java │ │ ├── NamingInsertSelectItemVisitorAdapter.java │ │ └── NamingInsertVisitorAdapter.java │ │ └── update │ │ └── NamingUpdateExpressionVisitorAdapter.java │ └── thrid │ └── jsqlparser │ ├── JSQLParserException.java │ ├── Model.java │ ├── expression │ ├── Alias.java │ ├── AllValue.java │ ├── AnalyticExpression.java │ ├── AnalyticType.java │ ├── AnyComparisonExpression.java │ ├── AnyType.java │ ├── ArrayConstructor.java │ ├── ArrayExpression.java │ ├── BinaryExpression.java │ ├── CaseExpression.java │ ├── CastExpression.java │ ├── CollateExpression.java │ ├── ConnectByRootOperator.java │ ├── DateTimeLiteralExpression.java │ ├── DateValue.java │ ├── DoubleValue.java │ ├── Expression.java │ ├── ExpressionVisitor.java │ ├── ExpressionVisitorAdapter.java │ ├── ExtractExpression.java │ ├── FilterOverImpl.java │ ├── Function.java │ ├── HexValue.java │ ├── IntervalExpression.java │ ├── JdbcNamedParameter.java │ ├── JdbcParameter.java │ ├── JsonAggregateFunction.java │ ├── JsonAggregateOnNullType.java │ ├── JsonAggregateUniqueKeysType.java │ ├── JsonExpression.java │ ├── JsonFunction.java │ ├── JsonFunctionExpression.java │ ├── JsonFunctionType.java │ ├── JsonKeyValuePair.java │ ├── KeepExpression.java │ ├── LongValue.java │ ├── MySQLGroupConcat.java │ ├── MySQLIndexHint.java │ ├── NextValExpression.java │ ├── NotExpression.java │ ├── NullValue.java │ ├── NumericBind.java │ ├── OracleHierarchicalExpression.java │ ├── OracleHint.java │ ├── OracleNamedFunctionParameter.java │ ├── OrderByClause.java │ ├── Parenthesis.java │ ├── PartitionByClause.java │ ├── RowConstructor.java │ ├── RowGetExpression.java │ ├── SQLServerHints.java │ ├── SignedExpression.java │ ├── StringValue.java │ ├── TimeKeyExpression.java │ ├── TimeValue.java │ ├── TimestampValue.java │ ├── TimezoneExpression.java │ ├── TryCastExpression.java │ ├── UserVariable.java │ ├── ValueListExpression.java │ ├── VariableAssignment.java │ ├── WhenClause.java │ ├── WindowElement.java │ ├── WindowOffset.java │ ├── WindowRange.java │ ├── XMLSerializeExpr.java │ └── operators │ │ ├── arithmetic │ │ ├── Addition.java │ │ ├── BitwiseAnd.java │ │ ├── BitwiseLeftShift.java │ │ ├── BitwiseOr.java │ │ ├── BitwiseRightShift.java │ │ ├── BitwiseXor.java │ │ ├── Concat.java │ │ ├── Division.java │ │ ├── IntegerDivision.java │ │ ├── Modulo.java │ │ ├── Multiplication.java │ │ └── Subtraction.java │ │ ├── conditional │ │ ├── AndExpression.java │ │ ├── OrExpression.java │ │ └── XorExpression.java │ │ └── relational │ │ ├── Between.java │ │ ├── ComparisonOperator.java │ │ ├── EqualsTo.java │ │ ├── ExistsExpression.java │ │ ├── ExpressionList.java │ │ ├── FullTextSearch.java │ │ ├── GeometryDistance.java │ │ ├── GreaterThan.java │ │ ├── GreaterThanEquals.java │ │ ├── InExpression.java │ │ ├── IsBooleanExpression.java │ │ ├── IsDistinctExpression.java │ │ ├── IsNullExpression.java │ │ ├── ItemsList.java │ │ ├── ItemsListVisitor.java │ │ ├── ItemsListVisitorAdapter.java │ │ ├── JsonOperator.java │ │ ├── LikeExpression.java │ │ ├── Matches.java │ │ ├── MinorThan.java │ │ ├── MinorThanEquals.java │ │ ├── MultiExpressionList.java │ │ ├── NamedExpressionList.java │ │ ├── NotEqualsTo.java │ │ ├── OldOracleJoinBinaryExpression.java │ │ ├── RegExpMatchOperator.java │ │ ├── RegExpMatchOperatorType.java │ │ ├── RegExpMySQLOperator.java │ │ ├── SimilarToExpression.java │ │ └── SupportsOldOracleJoinSyntax.java │ ├── parser │ ├── ASTNodeAccess.java │ ├── ASTNodeAccessImpl.java │ ├── AbstractJSqlParser.java │ ├── BaseToken.java │ ├── CCJSqlParser.java │ ├── CCJSqlParserConstants.java │ ├── CCJSqlParserDefaultVisitor.java │ ├── CCJSqlParserManager.java │ ├── CCJSqlParserTokenManager.java │ ├── CCJSqlParserTreeConstants.java │ ├── CCJSqlParserUtil.java │ ├── CCJSqlParserVisitor.java │ ├── JJTCCJSqlParserState.java │ ├── JSqlParser.java │ ├── Node.java │ ├── ParseException.java │ ├── Provider.java │ ├── SimpleCharStream.java │ ├── SimpleNode.java │ ├── StatementListener.java │ ├── StreamProvider.java │ ├── StringProvider.java │ ├── Token.java │ ├── TokenMgrException.java │ └── feature │ │ ├── Feature.java │ │ ├── FeatureConfiguration.java │ │ ├── FeatureSet.java │ │ └── ModifyableFeatureSet.java │ ├── schema │ ├── Column.java │ ├── Database.java │ ├── MultiPartName.java │ ├── Sequence.java │ ├── Server.java │ ├── Synonym.java │ └── Table.java │ ├── statement │ ├── Block.java │ ├── Commit.java │ ├── CreateFunctionalStatement.java │ ├── DeclareStatement.java │ ├── DeclareType.java │ ├── DescribeStatement.java │ ├── ExplainStatement.java │ ├── IfElseStatement.java │ ├── PurgeObjectType.java │ ├── PurgeStatement.java │ ├── ReferentialAction.java │ ├── ResetStatement.java │ ├── RollbackStatement.java │ ├── SavepointStatement.java │ ├── SetStatement.java │ ├── ShowColumnsStatement.java │ ├── ShowStatement.java │ ├── Statement.java │ ├── StatementVisitor.java │ ├── StatementVisitorAdapter.java │ ├── Statements.java │ ├── UseStatement.java │ ├── alter │ │ ├── Alter.java │ │ ├── AlterExpression.java │ │ ├── AlterOperation.java │ │ ├── AlterSession.java │ │ ├── AlterSessionOperation.java │ │ ├── AlterSystemOperation.java │ │ ├── AlterSystemStatement.java │ │ ├── ConstraintState.java │ │ ├── DeferrableConstraint.java │ │ ├── EnableConstraint.java │ │ ├── RenameTableStatement.java │ │ ├── ValidateConstraint.java │ │ └── sequence │ │ │ └── AlterSequence.java │ ├── comment │ │ └── Comment.java │ ├── create │ │ ├── function │ │ │ └── CreateFunction.java │ │ ├── index │ │ │ └── CreateIndex.java │ │ ├── procedure │ │ │ └── CreateProcedure.java │ │ ├── schema │ │ │ └── CreateSchema.java │ │ ├── sequence │ │ │ └── CreateSequence.java │ │ ├── synonym │ │ │ └── CreateSynonym.java │ │ ├── table │ │ │ ├── CheckConstraint.java │ │ │ ├── ColDataType.java │ │ │ ├── ColumnDefinition.java │ │ │ ├── CreateTable.java │ │ │ ├── ExcludeConstraint.java │ │ │ ├── ForeignKeyIndex.java │ │ │ ├── Index.java │ │ │ ├── NamedConstraint.java │ │ │ ├── RowMovement.java │ │ │ └── RowMovementMode.java │ │ └── view │ │ │ ├── AlterView.java │ │ │ ├── CreateView.java │ │ │ ├── ForceOption.java │ │ │ └── TemporaryOption.java │ ├── delete │ │ ├── Delete.java │ │ └── DeleteModifierPriority.java │ ├── drop │ │ └── Drop.java │ ├── execute │ │ └── Execute.java │ ├── grant │ │ └── Grant.java │ ├── insert │ │ ├── Insert.java │ │ └── InsertModifierPriority.java │ ├── merge │ │ ├── Merge.java │ │ ├── MergeInsert.java │ │ └── MergeUpdate.java │ ├── replace │ │ └── Replace.java │ ├── select │ │ ├── AllColumns.java │ │ ├── AllTableColumns.java │ │ ├── Distinct.java │ │ ├── ExceptOp.java │ │ ├── ExpressionListItem.java │ │ ├── Fetch.java │ │ ├── First.java │ │ ├── FromItem.java │ │ ├── FromItemVisitor.java │ │ ├── FromItemVisitorAdapter.java │ │ ├── FunctionItem.java │ │ ├── GroupByElement.java │ │ ├── GroupByVisitor.java │ │ ├── IntersectOp.java │ │ ├── IntoTableVisitor.java │ │ ├── IntoTableVisitorAdapter.java │ │ ├── Join.java │ │ ├── KSQLJoinWindow.java │ │ ├── KSQLWindow.java │ │ ├── LateralSubSelect.java │ │ ├── Limit.java │ │ ├── MinusOp.java │ │ ├── MySqlSqlCacheFlags.java │ │ ├── Offset.java │ │ ├── OptimizeFor.java │ │ ├── OrderByElement.java │ │ ├── OrderByVisitor.java │ │ ├── OrderByVisitorAdapter.java │ │ ├── ParenthesisFromItem.java │ │ ├── Pivot.java │ │ ├── PivotVisitor.java │ │ ├── PivotVisitorAdapter.java │ │ ├── PivotXml.java │ │ ├── PlainSelect.java │ │ ├── Select.java │ │ ├── SelectBody.java │ │ ├── SelectExpressionItem.java │ │ ├── SelectItem.java │ │ ├── SelectItemVisitor.java │ │ ├── SelectItemVisitorAdapter.java │ │ ├── SelectVisitor.java │ │ ├── SelectVisitorAdapter.java │ │ ├── SetOperation.java │ │ ├── SetOperationList.java │ │ ├── Skip.java │ │ ├── SpecialSubSelect.java │ │ ├── SubJoin.java │ │ ├── SubSelect.java │ │ ├── TableFunction.java │ │ ├── Top.java │ │ ├── UnPivot.java │ │ ├── UnionOp.java │ │ ├── ValuesList.java │ │ ├── Wait.java │ │ ├── WithIsolation.java │ │ └── WithItem.java │ ├── show │ │ └── ShowTablesStatement.java │ ├── truncate │ │ └── Truncate.java │ ├── update │ │ ├── Update.java │ │ ├── UpdateModifierPriority.java │ │ └── UpdateSet.java │ ├── upsert │ │ └── Upsert.java │ └── values │ │ └── ValuesStatement.java │ └── util │ ├── AddAliasesVisitor.java │ ├── ConnectExpressionsVisitor.java │ ├── SelectUtils.java │ ├── TablesNamesFinder.java │ ├── cnfexpression │ ├── CNFConverter.java │ ├── CloneHelper.java │ ├── MultiAndExpression.java │ ├── MultiOrExpression.java │ └── MultipleExpression.java │ ├── deparser │ ├── AbstractDeParser.java │ ├── AlterDeParser.java │ ├── AlterSequenceDeParser.java │ ├── AlterSessionDeParser.java │ ├── AlterViewDeParser.java │ ├── CreateIndexDeParser.java │ ├── CreateSequenceDeParser.java │ ├── CreateSynonymDeparser.java │ ├── CreateTableDeParser.java │ ├── CreateViewDeParser.java │ ├── DeclareStatementDeParser.java │ ├── DeleteDeParser.java │ ├── DropDeParser.java │ ├── ExecuteDeParser.java │ ├── ExpressionDeParser.java │ ├── GrantDeParser.java │ ├── GroupByDeParser.java │ ├── InsertDeParser.java │ ├── LimitDeparser.java │ ├── OrderByDeParser.java │ ├── ReplaceDeParser.java │ ├── ResetStatementDeParser.java │ ├── SelectDeParser.java │ ├── SetStatementDeParser.java │ ├── ShowColumnsStatementDeParser.java │ ├── ShowStatementDeParser.java │ ├── ShowTablesStatementDeparser.java │ ├── StatementDeParser.java │ ├── UpdateDeParser.java │ ├── UpsertDeParser.java │ ├── UseStatementDeParser.java │ └── ValuesStatementDeParser.java │ └── validation │ ├── ContextKey.java │ ├── ParseCapability.java │ ├── ParseContext.java │ ├── ParseException.java │ ├── UnexpectedValidationException.java │ ├── Validation.java │ ├── ValidationCapability.java │ ├── ValidationContext.java │ ├── ValidationError.java │ ├── ValidationException.java │ ├── ValidationUtil.java │ ├── Validator.java │ ├── allowedtypes │ ├── AllowedTypesContext.java │ └── AllowedTypesValidation.java │ ├── feature │ ├── DatabaseType.java │ ├── FeatureContext.java │ ├── FeatureSetValidation.java │ ├── FeaturesAllowed.java │ ├── H2Version.java │ ├── MariaDbVersion.java │ ├── MySqlVersion.java │ ├── OracleVersion.java │ ├── PostgresqlVersion.java │ ├── SQLVersion.java │ ├── SqlServerVersion.java │ └── Version.java │ ├── metadata │ ├── AbstractDatabaseMetaDataCapability.java │ ├── DatabaseException.java │ ├── DatabaseMetaDataValidation.java │ ├── JdbcDatabaseMetaDataCapability.java │ ├── MetadataContext.java │ ├── Named.java │ ├── NamedObject.java │ └── NamesLookup.java │ └── validator │ ├── AbstractValidator.java │ ├── AlterSequenceValidator.java │ ├── AlterSessionValidator.java │ ├── AlterValidator.java │ ├── AlterViewValidator.java │ ├── CreateIndexValidator.java │ ├── CreateSequenceValidator.java │ ├── CreateSynonymValidator.java │ ├── CreateTableValidator.java │ ├── CreateViewValidator.java │ ├── DeclareStatementValidator.java │ ├── DeleteValidator.java │ ├── DropValidator.java │ ├── ExecuteValidator.java │ ├── ExpressionValidator.java │ ├── GrantValidator.java │ ├── GroupByValidator.java │ ├── InsertValidator.java │ ├── ItemsListValidator.java │ ├── LimitValidator.java │ ├── MergeValidator.java │ ├── OrderByValidator.java │ ├── ReplaceValidator.java │ ├── ResetStatementValidator.java │ ├── SelectValidator.java │ ├── SetStatementValidator.java │ ├── ShowColumnsStatementValidator.java │ ├── ShowStatementValidator.java │ ├── ShowTablesStatementValidator.java │ ├── StatementValidator.java │ ├── UpdateValidator.java │ ├── UpsertValidator.java │ ├── UseStatementValidator.java │ └── ValuesStatementValidator.java ├── brief-support ├── brief-clickhouse │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── javaoffers │ │ └── brief │ │ └── modelhelper │ │ └── clickhouse │ │ ├── CHSelectConditionParse.java │ │ ├── CHStatementParser.java │ │ ├── CHTableInfoParser.java │ │ ├── ClickHouseStatementParser.java │ │ └── ClickHouseTableInfoParser.java ├── brief-mybatis │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ ├── com │ │ │ └── javaoffers │ │ │ │ └── brief │ │ │ │ └── modelhelper │ │ │ │ ├── aggent │ │ │ │ ├── InstallModelHelper.java │ │ │ │ └── MapperProxyAggentProcess.java │ │ │ │ ├── context │ │ │ │ ├── BriefMybatisConfigContext.java │ │ │ │ └── SpringMybatisBriefContext.java │ │ │ │ ├── exception │ │ │ │ └── VersionException.java │ │ │ │ ├── install │ │ │ │ ├── InitMapper.java │ │ │ │ └── InstallAgent.java │ │ │ │ └── proxy │ │ │ │ └── CrudMapperProxy.java │ │ └── org │ │ │ └── apache │ │ │ └── ibatis │ │ │ └── binding │ │ │ ├── MapperProxyFactoryAggent341.java │ │ │ └── MapperProxyFactoryAggent3511.java │ │ └── resources │ │ └── META-INF │ │ └── spring.factories ├── brief-oracle │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── javaoffers │ │ └── brief │ │ └── modelhelper │ │ └── oracle │ │ ├── OracleInsertAllColValueCondition.java │ │ ├── OracleInsertConditionParse.java │ │ ├── OracleLimitWordCondition.java │ │ ├── OracleSelectConditionParse.java │ │ ├── OracleStatementParser.java │ │ └── OracleTableInfoParser.java ├── brief-pgsql │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── javaoffers │ │ └── brief │ │ └── modelhelper │ │ └── pgsql │ │ ├── PostgreSqlInsertAllColValueCondition.java │ │ ├── PostgreSqlInsertConditionParse.java │ │ ├── PostgreSqlLimitWordCondition.java │ │ ├── PostgreSqlSelectConditionParse.java │ │ ├── PostgreSqlStatementParser.java │ │ └── PostgreSqlTableInfoParser.java ├── brief-spring-jdbc │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── javaoffers │ │ └── brief │ │ └── modelhelper │ │ └── jdbc │ │ └── spring │ │ ├── SpringBriefContext.java │ │ ├── SpringContextPostProcessor.java │ │ ├── SpringJdbcExecutor.java │ │ ├── SpringJdbcExecutorFactory.java │ │ ├── SpringModifyExecutor.java │ │ ├── SpringQueryExecutor.java │ │ └── SpringSaveExecutor.java ├── brief-sqlite │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── javaoffers │ │ └── brief │ │ └── modelhelper │ │ └── sqlite │ │ ├── SqliteInsertAllColValueCondition.java │ │ ├── SqliteInsertConditionParse.java │ │ ├── SqliteLimitWordCondition.java │ │ ├── SqliteSelectConditionParse.java │ │ ├── SqliteStatementParser.java │ │ └── SqliteTableInfoParser.java ├── brief-sqlserver │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── javaoffers │ │ └── brief │ │ └── modelhelper │ │ └── sqlserver │ │ ├── SqlServerInsertAllColValueCondition.java │ │ ├── SqlServerInsertConditionParse.java │ │ ├── SqlServerLimitWordCondition.java │ │ ├── SqlServerSelectConditionParse.java │ │ ├── SqlServerStatementParser.java │ │ └── SqlServerTableInfoParser.java └── pom.xml ├── checkstyle.xml ├── note-doc └── img │ ├── 2220967059897.png │ └── qq.jpg ├── pom.xml ├── readme.md ├── readmeCN.md ├── version.md └── wiki.md /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Current version 2 | 3 | 4 | 5 | ### How did the problem arise? (Make sure the latest version also has problems!!) 6 | 7 | 8 | 9 | ### Repeat steps 10 | 11 | 12 | 13 | ### Error message 14 | 15 | 16 | 17 | ### Your expectations 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Please do not create a Pull Request without creating an issue first. 2 | 3 | ## What is the purpose of the change 4 | xxxx 5 | 6 | 7 | ## The Issue associated with the Pull Request 8 | xxxx 9 | 10 | 11 | ## Brief changelog OR 12 | xxxx 13 | 14 | 15 | ## Verifying this change 16 | xxxx 17 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/EnumValue.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: support enum convert. 11 | * {@code EnumValue} cannot be in the same enumeration class on multiple attributes used at the same time. 12 | * Only mark in one of the attributes and have unique characteristics.No @EnumValue attribute will be ordinal 13 | * as default values. 14 | * @author: create by cmj on 2023/1/2 11:46 15 | */ 16 | @Target({ElementType.FIELD}) 17 | @Retention(RetentionPolicy.RUNTIME) 18 | @Inherited 19 | public @interface EnumValue { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/NoneCol.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * Not a table field or sql statement. Will be ignored when performing db operations 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface NoneCol { 17 | } 18 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/derive/Blur.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.derive; 2 | 3 | /** 4 | * fuzzy strategy 5 | * @author mingJie 6 | */ 7 | public enum Blur { 8 | 9 | /** 10 | * left blur 11 | */ 12 | FRONT_BLUR, 13 | 14 | /** 15 | * right blur 16 | */ 17 | POST_BLUR, 18 | 19 | /** 20 | * middle blur 21 | */ 22 | MIDDLE_BLUR 23 | 24 | } 25 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/derive/JsonColumn.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.derive; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 标记是一个json字段. 如果你的表中有json字段, 那么你只需要建一个类继承JsonColumn即可. 7 | * 注意: 综合考虑没有使用注解的方式去做. 8 | * @author mingJie 9 | */ 10 | public interface JsonColumn extends Serializable { 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/derive/flag/DeriveFlag.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.derive.flag; 2 | 3 | /** 4 | * @description: Derivative label 5 | * @author: create by cmj on 2023/6/11 17:51 6 | */ 7 | public enum DeriveFlag implements DeriveMark { 8 | //Version of the function 9 | VERSION, 10 | /** 11 | * {@link IsDel} 12 | * {@link RowStatus} 13 | */ 14 | IS_DEL, 15 | ; 16 | } 17 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/derive/flag/DeriveInfo.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.derive.flag; 2 | 3 | import java.lang.reflect.Field; 4 | 5 | /** 6 | * @description: info 7 | * @author: create by cmj on 2023/6/11 19:48 8 | */ 9 | public abstract class DeriveInfo { 10 | //col name of db 11 | private String colName; 12 | private Field field; 13 | 14 | 15 | public DeriveInfo(String colName, Field field) { 16 | this.colName = colName; 17 | this.field = field; 18 | } 19 | 20 | public String getColName() { 21 | return colName; 22 | } 23 | 24 | public Field getField() { 25 | return field; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/derive/flag/DeriveMark.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.derive.flag; 2 | 3 | public interface DeriveMark { 4 | } 5 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/derive/flag/IsDel.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.derive.flag; 2 | 3 | import com.javaoffers.brief.modelhelper.anno.EnumValue; 4 | 5 | /** 6 | * @description: Whether or not to be deleted 7 | * @author: create by cmj on 2023/6/11 01:39 8 | */ 9 | public enum IsDel { 10 | //Data is logically deleted 11 | YES(1), 12 | //data is valid, there is not be logically deleted 13 | NO(0), 14 | ; 15 | @EnumValue 16 | private int code; 17 | 18 | IsDel(int code){ 19 | this.code = code; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/derive/flag/RowStatus.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.derive.flag; 2 | 3 | import com.javaoffers.brief.modelhelper.anno.EnumValue; 4 | 5 | /** 6 | * Whether or not to be deleted 7 | * @author mingJie 8 | */ 9 | public enum RowStatus { 10 | 11 | /** 12 | * Data is logically deleted 13 | */ 14 | ABSENT(0), 15 | 16 | /** 17 | * data is valid, there is not be logically deleted 18 | */ 19 | PRESENCE(1) 20 | 21 | ; 22 | @EnumValue 23 | private int code; 24 | 25 | RowStatus(int code){ 26 | this.code = code; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/derive/flag/ShardingStrategyMark.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.derive.flag; 2 | 3 | /** 4 | * desc. 5 | * 6 | * @author cao ming jie create by 2025/5/2 7 | */ 8 | public enum ShardingStrategyMark implements DeriveMark { 9 | SHARDING_TABLE_STRATEGY; 10 | } 11 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/noneparam/math/Rand.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.noneparam.math; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * select RAND() 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Rand { 17 | public static final String TAG = "RAND"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/noneparam/time/Curdate.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.noneparam.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * CURDATE() 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Curdate { 17 | public static final String TAG = "CURDATE"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/noneparam/time/CurrentDate.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.noneparam.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * CURRENT_DATE() 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface CurrentDate { 17 | public static final String TAG = "CURRENT_DATE"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/noneparam/time/CurrentTime.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.noneparam.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * CURRENT_TIME() 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface CurrentTime { 17 | public static final String TAG = "CURRENT_TIME"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/noneparam/time/Curtime.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.noneparam.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * CURTIME() 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Curtime { 17 | public static final String TAG = "CURTIME"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/noneparam/time/Now.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.noneparam.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * now() 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Now { 17 | public static final String TAG = "NOW"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/noneparam/time/UnixTimestamp.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.noneparam.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: unix_timestamp(); 11 | * @author: create by cmj on 2022/10/15 17:01 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface UnixTimestamp { 17 | public static final String TAG = "UNIX_TIMESTAMP"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/IfEq.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * extended if: if (colName = xx, ep1, ep2) 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface IfEq { 17 | public static String EXPR = " = "; 18 | /** 19 | * colName equal xx. 20 | */ 21 | String eq(); 22 | /** 23 | * expr1 24 | */ 25 | String ep1(); 26 | 27 | /** 28 | * expr2 29 | */ 30 | String ep2(); 31 | } 32 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/IfLt.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * extended if: if (colName < xx, ep1, ep2) 11 | * colName < xx 12 | * @author mingJie 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface IfLt { 18 | public static String EXPR = " < "; 19 | /** 20 | * colName less than xx. 21 | */ 22 | String lt(); 23 | /** 24 | * expr1 25 | */ 26 | String ep1(); 27 | 28 | /** 29 | * expr2 30 | */ 31 | String ep2(); 32 | } 33 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/IfLte.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * extended if: if (colName <= xx, ep1, ep2) 11 | * colName <= xx 12 | * @author mingJie 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface IfLte { 18 | public static String EXPR = " <= "; 19 | /** 20 | * colName less than or equal xx. 21 | */ 22 | String lte(); 23 | /** 24 | * expr1 25 | */ 26 | String ep1(); 27 | 28 | /** 29 | * expr2 30 | */ 31 | String ep2(); 32 | } 33 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/IfNeq.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * extended if: if (colName != xx, ep1, ep2) 11 | * colName != xx 12 | * @author mingJie 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface IfNeq { 18 | public static String EXPR = " != "; 19 | /** 20 | * colName not equal xx. 21 | */ 22 | String neq(); 23 | /** 24 | * expr1 25 | */ 26 | String ep1(); 27 | 28 | /** 29 | * expr2 30 | */ 31 | String ep2(); 32 | } 33 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/IfNull.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * ifNull(colName, 'defalut value'). 11 | * sample: 12 | *

13 | * @ColName("name") 14 | * @IfNull("'Amop'") 15 | * private String colName; 16 | *

17 | * create by cmj 18 | */ 19 | @Target({ElementType.FIELD}) 20 | @Retention(RetentionPolicy.RUNTIME) 21 | @Inherited 22 | public @interface IfNull { 23 | public static final String TAG = "IFNULL"; 24 | /** 25 | * defalut value 26 | */ 27 | String value() ; 28 | } 29 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/Left.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * select left(colName, length) 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Left { 17 | public static final String TAG = "LEFT"; 18 | 19 | /** 20 | * length 21 | */ 22 | int value(); 23 | } 24 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/Right.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: RIGHT(colName,len) 11 | * @author: create by cmj on 2022/10/15 15:09 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Right { 17 | public static final String TAG = "RIGHT"; 18 | int value(); 19 | } 20 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/math/Abs.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.math; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * https://blog.csdn.net/weixin_51696091/article/details/124731621 11 | * Absolute value function: abs(colName) 12 | * @author mingJie 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface Abs { 18 | public static final String TAG = "ABS"; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/math/Ceil.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.math; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * select CEIL(colName) 11 | * CEIL(3.2) : 4 12 | * @author mingJie 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface Ceil { 18 | 19 | public static final String TAG = "CEIL"; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/math/Floor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.math; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * select FLOOR(colName) 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Floor { 17 | public static final String TAG = "FLOOR"; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/math/Mod.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.math; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * MOD(colName, xx) 11 | * SELECT MOD(234, 10); # 4 12 | * @author mingJie 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface Mod { 18 | public static final String TAG = "MOD"; 19 | 20 | /** 21 | * colName mod xx 22 | */ 23 | int value(); 24 | } 25 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/math/Round.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.math; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * ROUND(colName, precision) 11 | * ROUND(20.5,0) 21 12 | * @author mingJie 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface Round { 18 | public static final String TAG = "ROUND"; 19 | 20 | /** 21 | * Accuracy 22 | */ 23 | int precision() default 0; 24 | } 25 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/math/Truncate.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.math; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * TRUNCATE(colName, precision) 11 | * TRUNCATE(7.536432,2); 7.53 12 | * Numerical intercept function 13 | * @author mingJie 14 | */ 15 | @Target({ElementType.FIELD}) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Inherited 18 | public @interface Truncate { 19 | 20 | public static final String TAG = "TRUNCATE"; 21 | 22 | /** 23 | * Preserve the length after the decimal point. 24 | * value of precision 25 | */ 26 | int value() default 0; 27 | } 28 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/DateFormat.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: date_format(colName,format) 11 | * @author: create by cmj on 2022/10/15 16:19 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface DateFormat { 17 | public static final String TAG = "DATE_FORMAT"; 18 | 19 | /** 20 | * format 21 | */ 22 | String value(); 23 | } 24 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/Dayname.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * DAYNAME(colName) 11 | * SELECT DAYNAME(now()); # Sunday 12 | * @author mingJie 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface Dayname { 18 | public static final String TAG = "DAYNAME"; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/FromDays.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: from_days(colName) 11 | * Returns a date from a numeric date value 12 | * SELECT FROM_DAYS(780500); output 2136-12-08 13 | * @author: create by cmj on 2022/10/15 16:37 14 | */ 15 | @Target({ElementType.FIELD}) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Inherited 18 | public @interface FromDays { 19 | public static final String TAG = "FROM_DAYS"; 20 | } 21 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/Hour.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * HOUR(colName) 11 | * SELECT HOUR('10:05:03'); output 10 12 | * @author mingJie 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface Hour { 18 | public static final String TAG = "HOUR"; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/Makedate.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: makedate(colName, days) 11 | * select makedate(2001,31); -- '2001-01-31' 12 | * select makedate(2001,32); -- '2001-02-01' 13 | * @author: create by cmj on 2022/10/15 17:03 14 | */ 15 | @Target({ElementType.FIELD}) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Inherited 18 | public @interface Makedate { 19 | public static final String TAG = "MAKEDATE"; 20 | 21 | /** 22 | * days 23 | */ 24 | int value(); 25 | } 26 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/Maketime.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: maketime(colName ,minute, second) 11 | * select maketime(12,15,30); -- '12:15:30' 12 | * @author: create by cmj on 2022/10/15 17:07 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface Maketime { 18 | public static final String TAG = "MAKETIME"; 19 | 20 | /** 21 | * minute 22 | */ 23 | int ep1(); 24 | 25 | /** 26 | * second 27 | */ 28 | int ep2(); 29 | } 30 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/Minute.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * MINUTE(colName) 11 | * select minute('2018-9-28 10:20:25.000002') ; 20 12 | * @author mingJie 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface Minute { 18 | public static final String TAG = "MINUTE"; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/Month.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * MONTH(colName) 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Month { 17 | public static final String TAG = "MONTH"; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/Monthname.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * MONTHNAME(colName) 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Monthname { 17 | public static final String TAG = "MONTHNAME"; 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/SecToTime.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: sec_to_time(colName) 11 | * @author: create by cmj on 2022/10/15 16:48 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface SecToTime { 17 | 18 | public static final String TAG = "SEC_TO_TIME"; 19 | } 20 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/TimeFormat.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: time_format(colName,format) 11 | * @author: create by cmj on 2022/10/15 16:19 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface TimeFormat { 17 | public static final String TAG = "TIME_FORMAT"; 18 | 19 | /** 20 | * format 21 | */ 22 | String value(); 23 | } 24 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/TimeToSec.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: time_to_sec(colName) Converts a time value to a second value 11 | * TIME_TO_SEC('15:15:15') output 54915 12 | * @author: create by cmj on 2022/10/15 16:41 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface TimeToSec { 18 | public static final String TAG = "TIME_TO_SEC"; 19 | } 20 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/ToDays.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: to_days(colName) 11 | * @author: create by cmj on 2022/10/15 16:33 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface ToDays { 17 | public static final String TAG = "TO_DAYS"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/Week.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * WEEK(colName) 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Week { 17 | public static final String TAG = "WEEK"; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/Weekday.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /**WEEKDAY(colName) 10 | * @author mingJie 11 | */ 12 | @Target({ElementType.FIELD}) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Inherited 15 | public @interface Weekday { 16 | public static final String TAG = "WEEKDAY"; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/time/Year.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.time; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * YEAR(colName) 11 | * @author mingJie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Year { 17 | public static final String TAG = "YEAR"; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/varchar/CharLength.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.varchar; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * Get the number of characters in a string function: char_length(str) 11 | * create by cmj 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface CharLength { 17 | public static final String TAG = "CHAR_LENGTH"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/varchar/LTrim.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.varchar; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: LTRIM(str) 11 | * @author: create by cmj on 2022/10/15 15:15 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface LTrim { 17 | public static final String TAG = "LTRIM"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/varchar/Length.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.varchar; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * Get the number of bytes in a string function: length(str) 11 | * create by mingjie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Length { 17 | public static String TAG = "LENGTH"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/varchar/Lower.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.varchar; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * lower(x) 11 | * create by mingjie 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Lower { 17 | public static final String TAG = "LOWER"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/varchar/RTrim.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.varchar; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: RTRIM(str) 11 | * @author: create by cmj on 2022/10/15 15:15 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface RTrim { 17 | public static final String TAG = "RTRIM"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/varchar/Repeat.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.varchar; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: REPEAT(str,x) The number of times used to repeat a string. 11 | * @author: create by cmj on 2022/10/15 15:15 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Repeat { 17 | public static final String TAG = "REPEAT"; 18 | int value(); 19 | } 20 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/varchar/Replace.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.varchar; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: REPLACE(colName, ep1, ep2) 11 | * @author: create by cmj on 2022/10/15 15:15 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Replace { 17 | public static final String TAG = "REPLACE"; 18 | String ep1(); 19 | String ep2(); 20 | } 21 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/varchar/Strcmp.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.varchar; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * strcmp(colName,expr): compareStringSizeFunction 11 | * create by cmj 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Strcmp { 17 | public static final String TAG = "STRCMP"; 18 | 19 | /** 20 | * expr 21 | */ 22 | String value(); 23 | } 24 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/varchar/SubString.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.varchar; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: SUBSTRING(colName, ep1, ep2) 11 | * @author: create by cmj on 2022/10/15 15:15 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface SubString { 17 | public static final String TAG = "SUBSTRING"; 18 | String ep1(); 19 | String ep2(); 20 | } 21 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/varchar/Trim.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.varchar; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * @description: TRIM(str) 11 | * @author: create by cmj on 2022/10/15 15:15 12 | */ 13 | @Target({ElementType.FIELD}) 14 | @Retention(RetentionPolicy.RUNTIME) 15 | @Inherited 16 | public @interface Trim { 17 | public static final String TAG = "TRIM"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/fun/params/varchar/Upper.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.fun.params.varchar; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * Uppercase: upper(x) 11 | * create by mingjie 12 | * 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface Upper { 18 | 19 | public static final String TAG = "UPPER"; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/anno/internal/NotNull.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.anno.internal; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * It is used for prompting information. The ability to verify when there is no time 11 | * @author mingJie 12 | */ 13 | @Documented 14 | @Retention(RetentionPolicy.CLASS) 15 | @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE}) 16 | public @interface NotNull { 17 | } 18 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/briefstate/BriefCommonComponentStates.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.briefstate; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public class BriefCommonComponentStates { 7 | 8 | //Whether the encryption component is enabled 9 | public static volatile boolean ENCRYPT_STATE = false; 10 | } 11 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/constants/ConfigPropertiesConstants.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.constants; 2 | 3 | /** 4 | * @description: brief properties 5 | * @author: create by cmj on 2023/5/28 01:46 6 | */ 7 | public interface ConfigPropertiesConstants { 8 | 9 | String SLOW_LOG_TIME = "brief:slow-sql:time"; 10 | 11 | String IS_PRINT_SQL = "brief:print-sql"; 12 | 13 | String IS_PRINT_SQL_COST = "brief:print-cost"; 14 | } 15 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/constants/ModelHelpperConstants.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.constants; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public interface ModelHelpperConstants { 7 | 8 | String NULL = "__NULL__"; 9 | 10 | String FIELD_COL_NAME = "__FIELD_COL_NAME__"; 11 | 12 | //split_line 13 | String SPLIT_LINE = "__"; 14 | 15 | double BLUR_PERCENT= 0.3; 16 | 17 | String BLUR_TAG = "*"; 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/context/BriefContextAware.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.context; 2 | 3 | /** 4 | * 有一些对象想使用BriefContext 对象中的信息,则可以实现该接口. 5 | * 此时的briefContext已经创建完毕. 6 | * @author mingJie 7 | */ 8 | public interface BriefContextAware { 9 | 10 | /** 11 | * 发布BriefContext可用 12 | * @param briefContext 13 | */ 14 | void setBriefContext(BriefContext briefContext); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/context/BriefContextPostProcessor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.context; 2 | 3 | /** 4 | * brief上下文后置处理器. 不对外提供功能. BriefContext 处于处理过程中. 5 | * @author mingJie 6 | */ 7 | public interface BriefContextPostProcessor { 8 | 9 | /** 10 | * 子类要保证每次执行结果都是一致的. 11 | * @param briefContext 12 | */ 13 | void postProcess(BriefContext briefContext); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/context/BriefPropertiesLoader.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.context; 2 | 3 | /** 4 | * 配置加载器,不对外提供。 5 | * @author mingJie 6 | */ 7 | public interface BriefPropertiesLoader { 8 | 9 | void startLoader(BriefProperties briefProperties); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/context/ConditionInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.context; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.Condition; 4 | import com.javaoffers.brief.modelhelper.fun.ConditionContext; 5 | 6 | import java.util.LinkedList; 7 | 8 | /** 9 | * 在每一个condition添加到list时,可以进行拦截判断. 10 | * 11 | * @author cao ming jie create by 2025/4/30 12 | */ 13 | public interface ConditionInterceptor extends Interceptor{ 14 | 15 | /** 16 | * condition 拦截器 17 | * @param conditions conditions 18 | * @param condition 当前准备add 的condition 19 | * @return true mean that the condition will be added 2 the conditions , 20 | * false will be not added 2 the conditions 21 | */ 22 | boolean process(ConditionContext conditions, Condition condition); 23 | } 24 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/context/DeriveInfoLoader.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.context; 2 | 3 | import com.javaoffers.brief.modelhelper.utils.TableInfo; 4 | 5 | import java.lang.reflect.Field; 6 | 7 | /** 8 | * 处理自定义衍生功能 9 | */ 10 | public interface DeriveInfoLoader { 11 | /** 12 | * 加载衍生配置. 13 | * @param tableInfo 表信息 14 | * @param colF 表字段 15 | * @param colName 表名称 16 | */ 17 | void loadDeriveInfo(TableInfo tableInfo, Field colF, String colName); 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/context/Interceptor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.context; 2 | 3 | /** 4 | * @description: 5 | * @author: create by cmj on 2023/3/25 20:24 6 | */ 7 | public interface Interceptor { 8 | } 9 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/context/JqlInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.context; 2 | 3 | import com.javaoffers.brief.modelhelper.core.BaseSQLInfo; 4 | 5 | /** 6 | * {@code SQLParse} 对jql信息拦截,在真正执行之前可修改数据. 7 | */ 8 | public interface JqlInterceptor extends Interceptor { 9 | 10 | void handler(BaseSQLInfo baseSQLInfo); 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/context/JqlInterceptorLoader.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.context; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 加载Jql拦截器,外部不可用. 主要加载brief内部自定义的. 7 | * 只需要实现JqlInterceptorLoader中的loadJqlInterceptor方法即可. 8 | */ 9 | public interface JqlInterceptorLoader extends BriefContextPostProcessor { 10 | 11 | @Override 12 | default void postProcess(BriefContext briefContext) { 13 | List jqlInterceptors = briefContext.getJqlInterceptors(); 14 | //加载指定jql拦接器 15 | JqlInterceptor jqlInterceptor = loadJqlInterceptor(); 16 | if(jqlInterceptor != null){ 17 | jqlInterceptors.add(jqlInterceptor); 18 | } 19 | } 20 | 21 | /** 22 | * 加载自定义Jql拦截器. 23 | */ 24 | abstract JqlInterceptor loadJqlInterceptor(); 25 | } 26 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/core/BaseSQLInfo.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core; 2 | 3 | import com.javaoffers.brief.modelhelper.utils.DBType; 4 | import com.javaoffers.brief.modelhelper.utils.SQLType; 5 | 6 | import java.util.List; 7 | import java.util.Map; 8 | import java.util.function.Consumer; 9 | 10 | public interface BaseSQLInfo { 11 | public String getSql(); 12 | public List> getParams(); 13 | public void resetSql(String sql); 14 | public int getBatchSize(); 15 | public List getArgsParam(); 16 | public SQLType getSqlType(); 17 | public DBType getDbType(); 18 | public Consumer getStreaming(); 19 | public void setStreaming(Consumer consumer); 20 | public BaseSQLInfo clone(); 21 | } 22 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/core/BaseSQLStatement.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | /** 7 | * sql信息 8 | * @author mingJie 9 | */ 10 | public interface BaseSQLStatement { 11 | /** 12 | * 是否有效 13 | * @return 14 | */ 15 | public boolean isStatus(); 16 | 17 | /** 18 | * 获取sql 19 | * @return 20 | */ 21 | public String getSql(); 22 | 23 | /** 24 | * 获取sql中的参数 25 | * @return 26 | */ 27 | public List> getParams(); 28 | } 29 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/core/ConvertProxy.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public interface ConvertProxy { 7 | public T convert(Object srcValue); 8 | } 9 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/core/Limit.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core; 2 | 3 | public interface Limit { 4 | public int pageNum(); 5 | 6 | public int pageSize(); 7 | 8 | public int startIndex(); 9 | 10 | public String cleanLimit(String sql); 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/core/UniqueKeyGenerate.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public interface UniqueKeyGenerate { 7 | 8 | /** 9 | * 生成唯一key. 10 | */ 11 | K generate(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/core/gkey/AtoIncrementSequenceKey.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core.gkey; 2 | 3 | import com.javaoffers.brief.modelhelper.core.UniqueKeyGenerate; 4 | 5 | import java.util.Date; 6 | import java.util.concurrent.atomic.AtomicLong; 7 | 8 | /** 9 | * 自增, 长度27位, nowTime(固定不变11位) + increment(原子自增 16位.). 10 | * @author mingJie 11 | */ 12 | public class AtoIncrementSequenceKey implements UniqueKeyGenerate { 13 | static final String prefix = Long.toHexString(new Date().getTime()); 14 | public static final AtomicLong key = new AtomicLong(1000000000000000000L); 15 | 16 | @Override 17 | public String generate() { 18 | return prefix + Long.toHexString(key.incrementAndGet()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/core/gkey/UUIDKey.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core.gkey; 2 | 3 | import com.javaoffers.brief.modelhelper.core.UniqueKeyGenerate; 4 | 5 | import java.util.UUID; 6 | 7 | /** 8 | * @author mingJie 9 | */ 10 | public class UUIDKey implements UniqueKeyGenerate { 11 | @Override 12 | public String generate() { 13 | return UUID.randomUUID().toString(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/core/gkey/VoidKey.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core.gkey; 2 | 3 | import com.javaoffers.brief.modelhelper.core.UniqueKeyGenerate; 4 | 5 | /** 6 | * @author mingJie 7 | */ 8 | public class VoidKey implements UniqueKeyGenerate { 9 | @Override 10 | public Object generate() { 11 | throw new UnsupportedOperationException("UniqueKeyGenerate VoidKey"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/BaseException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/9 11:33 6 | */ 7 | public class BaseException extends RuntimeException { 8 | public BaseException(String message) { 9 | super(message); 10 | } 11 | 12 | public BaseException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/BriefException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: 公共异常 5 | * @Auther: create by cmj on 2022/6/11 23:11 6 | */ 7 | public class BriefException extends RuntimeException { 8 | public BriefException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/BriefTransactionException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: 事务异常 5 | * @Auther: create by cmj on 2022/6/11 23:11 6 | */ 7 | public class BriefTransactionException extends RuntimeException { 8 | public BriefTransactionException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/ClassNotFindException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public class ClassNotFindException extends RuntimeException { 7 | 8 | public ClassNotFindException(String message, Throwable cause) { 9 | super(message, cause); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/ConnectionException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public class ConnectionException extends RuntimeException { 7 | public ConnectionException(String message) { 8 | super(message); 9 | } 10 | 11 | public ConnectionException(String message, Throwable cause) { 12 | super(message, cause); 13 | } 14 | } -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/EnumValueException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: Error looking up field. 5 | * @Auther: create by cmj on 2022/6/11 23:11 6 | */ 7 | public class EnumValueException extends RuntimeException { 8 | public EnumValueException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/FindColException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: Error looking up field. 5 | * @Auther: create by cmj on 2022/6/11 23:11 6 | */ 7 | public class FindColException extends RuntimeException { 8 | public FindColException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/GetColValueException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: Error looking up field value. 5 | * @Auther: create by cmj on 2022/6/11 23:11 6 | */ 7 | public class GetColValueException extends RuntimeException { 8 | public GetColValueException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/JdbcException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public class JdbcException extends RuntimeException { 7 | 8 | public JdbcException(String message, Throwable cause) { 9 | super(message, cause); 10 | } 11 | 12 | public JdbcException(String message) { 13 | super(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/NewInstanceException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: 初始化实例异常 5 | * @Auther: create by cmj on 2022/6/11 23:11 6 | */ 7 | public class NewInstanceException extends RuntimeException { 8 | public NewInstanceException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/ParseDataSourceException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public class ParseDataSourceException extends RuntimeException { 7 | 8 | public ParseDataSourceException(String message, Throwable cause) { 9 | super(message, cause); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/ParseModelException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public class ParseModelException extends RuntimeException { 7 | 8 | public ParseModelException(String message, Throwable cause) { 9 | super(message, cause); 10 | } 11 | 12 | public ParseModelException(String message) { 13 | super(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/ParseParamException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public class ParseParamException extends RuntimeException { 7 | 8 | public ParseParamException(String message, Throwable cause) { 9 | super(message, cause); 10 | } 11 | 12 | public ParseParamException(String message) { 13 | super(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/ParseResultSetException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: Error looking up field value. 5 | * @Auther: create by cmj on 2022/6/11 23:11 6 | */ 7 | public class ParseResultSetException extends RuntimeException { 8 | public ParseResultSetException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/ParseTableException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public class ParseTableException extends RuntimeException { 7 | 8 | public ParseTableException(String message, Throwable cause) { 9 | super(message, cause); 10 | } 11 | 12 | public ParseTableException(String message) { 13 | super(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/PrimaryKeyNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @description: 5 | * @author: create by cmj on 2023/6/19 22:43 6 | */ 7 | public class PrimaryKeyNotFoundException extends RuntimeException { 8 | public PrimaryKeyNotFoundException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/QueryDataException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: query data exception 5 | * @Auther: create by cmj on 2022/6/11 23:11 6 | */ 7 | public class QueryDataException extends RuntimeException { 8 | public QueryDataException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/ShardingConfigExecException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: 分表配置错误 5 | * @Auther: create by cmj on 2022/6/11 23:11 6 | */ 7 | public class ShardingConfigExecException extends RuntimeException { 8 | public ShardingConfigExecException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/SqlAesProcessException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: Error looking up field. 5 | * @Auther: create by cmj on 2022/6/11 23:11 6 | */ 7 | public class SqlAesProcessException extends RuntimeException { 8 | public SqlAesProcessException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/SqlParseException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/9 11:33 6 | */ 7 | public class SqlParseException extends BaseException { 8 | public SqlParseException(String message) { 9 | super(message); 10 | } 11 | 12 | public SqlParseException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | 16 | @Override 17 | public void printStackTrace() { 18 | super.printStackTrace(); 19 | super.getCause().printStackTrace(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/StopExecException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: 停止执行异常,也是可忽略的异常 5 | * @Auther: create by cmj on 2022/6/11 23:11 6 | */ 7 | public class StopExecException extends RuntimeException { 8 | public StopExecException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/exception/UpdateFieldsException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/9 11:33 6 | */ 7 | public class UpdateFieldsException extends RuntimeException { 8 | public UpdateFieldsException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/filter/Filter.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.filter; 2 | 3 | /** 4 | * @description: 5 | * @author: create by cmj on 2023/3/25 20:43 6 | */ 7 | public interface Filter { 8 | R filter (S s); 9 | } 10 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/filter/JqlExecutorFilter.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.filter; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public interface JqlExecutorFilter extends Filter, Comparable{ 7 | 8 | Integer MIN_ORDER = Integer.MIN_VALUE >> 2; 9 | 10 | Integer MAX_ORDER = Integer.MAX_VALUE >> 2; 11 | 12 | default int compareTo(JqlExecutorFilter o){ 13 | return this.orderId() - o.orderId(); 14 | } 15 | default int orderId(){ 16 | return 0; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/filter/JqlFunFilter.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.filter; 2 | 3 | import java.lang.reflect.Field; 4 | 5 | /** 6 | * @description: 内部过滤器. 需要在TableHelper显示声明. 7 | * @author: create by cmj on 2023/3/25 20:31 8 | */ 9 | public interface JqlFunFilter extends Filter { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/filter/impl/AsSqlFunFilterImpl.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.filter.impl; 2 | 3 | import com.javaoffers.brief.modelhelper.filter.JqlFunFilter; 4 | import com.javaoffers.brief.modelhelper.utils.BlurUtils; 5 | 6 | import java.lang.reflect.Field; 7 | 8 | /** 9 | * @description: The field as SQL fun. But not a must be SQL fun. We just use SQL fun features. 10 | * Avoid will refresh the database data update or save 11 | * @author: create by cmj on 2023/3/25 20:39 12 | */ 13 | public class AsSqlFunFilterImpl implements JqlFunFilter { 14 | 15 | @Override 16 | public Boolean filter(Field field) { 17 | if(field != null){ 18 | return BlurUtils.containsBlurAnno(field); 19 | } 20 | return false; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/fun/CategoryTag.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | /** 4 | * @Description: 类别 tag 5 | * @Auther: create by cmj on 2022/5/2 16:41 6 | */ 7 | public enum CategoryTag { 8 | 9 | WHERE_ON, 10 | SELECT_COL, 11 | JOIN_TABLE, 12 | SELECT_FROM, 13 | DELETE_FROM, 14 | INSERT_INTO, 15 | UPDATE_SET, 16 | KEY_WORD, 17 | } 18 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/fun/Condition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * @Description: conditional excuse 7 | * @Auther: create by cmj on 2022/5/2 02:22 8 | */ 9 | public interface Condition { 10 | 11 | public ConditionTag getConditionTag(); 12 | 13 | public String getSql(); 14 | 15 | public Map getParams(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/fun/ConstructorFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | /** 4 | * @Description: 无参构造 5 | * @Auther: create by cmj on 2022/5/4 17:20 6 | */ 7 | public interface ConstructorFun { 8 | T f(); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/fun/G4GetterFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * create by cmj 表示: getter方法 7 | * @param 8 | * @param 9 | */ 10 | @FunctionalInterface 11 | public interface G4GetterFun extends Serializable ,GetterFun{ 12 | B reply(A a); 13 | } -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/fun/G5GetterFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * create by cmj 表示: getter方法 7 | * @param 8 | * @param 9 | */ 10 | @FunctionalInterface 11 | public interface G5GetterFun extends Serializable, GGetterFun{ 12 | B reply(A a); 13 | } -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/fun/GGGetterFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * create by cmj 表示: getter方法 7 | * @param 8 | * @param 9 | */ 10 | @FunctionalInterface 11 | public interface GGGetterFun extends Serializable ,GetterFun{ 12 | B reply(A a); 13 | } -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/fun/GGetterFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * create by cmj 表示: getter方法 7 | * @param 8 | * @param 9 | */ 10 | @FunctionalInterface 11 | public interface GGetterFun extends Serializable ,GetterFun{ 12 | B reply(A a); 13 | } -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/fun/GetterFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * create by cmj 表示: getter方法 7 | * @param 8 | * @param 9 | */ 10 | @FunctionalInterface 11 | public interface GetterFun extends Serializable { 12 | B reply(A b); 13 | } -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/fun/ShardingCondition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | /** 4 | * desc. 5 | * 6 | * @author cao ming jie create by 2025/5/9 7 | */ 8 | public interface ShardingCondition extends Condition{ 9 | /** 10 | * 支持sharding table 11 | * @param tableName 12 | */ 13 | void shardingTableName(String tableName); 14 | 15 | /** 16 | * 获取表名 17 | * @return 18 | */ 19 | String getTableName(); 20 | 21 | /** 22 | * 获取sharding状态 23 | * @return 24 | */ 25 | boolean isDone(); 26 | 27 | /** 28 | * 克隆一份新的数据, 29 | * @param tableName 新数据的新表名 30 | * @return 31 | */ 32 | ShardingCondition clone(String tableName); 33 | } 34 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/jdbc/JdbcExecutorFactory.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.jdbc; 2 | 3 | import javax.sql.DataSource; 4 | 5 | /** 6 | * @author mingJie 7 | */ 8 | public interface JdbcExecutorFactory { 9 | 10 | JdbcExecutor createJdbcExecutor(DataSource dataSource, Class modelClass); 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/jdbc/ModifyExecutor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.jdbc; 2 | 3 | import com.javaoffers.brief.modelhelper.core.Id; 4 | import com.javaoffers.brief.modelhelper.core.BaseSQLInfo; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @description: modify 10 | * @author: create by cmj on 2023/7/29 18:26 11 | */ 12 | public interface ModifyExecutor extends DataSourceExecutor{ 13 | 14 | int modify(BaseSQLInfo sql); 15 | 16 | int batchModify(BaseSQLInfo sql); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/jdbc/QueryExecutor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.jdbc; 2 | 3 | import com.javaoffers.brief.modelhelper.core.BaseSQLInfo; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @description: query 9 | * @author: create by cmj on 2023/7/29 18:26 10 | */ 11 | public interface QueryExecutor extends DataSourceExecutor{ 12 | 13 | T query(BaseSQLInfo sql); 14 | 15 | List queryList(BaseSQLInfo sql); 16 | 17 | int queryStream(BaseSQLInfo sql); 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/jdbc/ResultSetExecutor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.jdbc; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @description: BriefResultSet 7 | * @author: create by cmj on 2023/7/30 13:25 8 | */ 9 | public interface ResultSetExecutor { 10 | 11 | List getColNames(); 12 | 13 | Object getColValueByColName(String colName); 14 | 15 | Object getColValueByColPosition(int position); 16 | 17 | public boolean nextRow(); 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/jdbc/SaveExecutor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.jdbc; 2 | 3 | import com.javaoffers.brief.modelhelper.core.BaseSQLInfo; 4 | import com.javaoffers.brief.modelhelper.core.Id; 5 | 6 | import java.sql.SQLException; 7 | import java.util.List; 8 | 9 | /** 10 | * @description: save 11 | * @author: create by cmj on 2023/7/29 18:26 12 | */ 13 | public interface SaveExecutor extends DataSourceExecutor{ 14 | 15 | Id save(BaseSQLInfo sql); 16 | 17 | List batchSave(BaseSQLInfo sql) throws SQLException; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/mapper/BaseMapper.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.mapper; 2 | 3 | /** 4 | * create by cmj 5 | * @param 6 | */ 7 | public interface BaseMapper { 8 | } 9 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/parser/MarkConditionParser.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.parser; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.Condition; 4 | import com.javaoffers.brief.modelhelper.utils.DBTypeLabel; 5 | 6 | /** 7 | * Condition解析器,针对于一下特殊处理的Condition进行处理. 8 | * 比如{@code LimitWordCondition} 不同的数据库语法不同,因此需要特殊解析进行处理. 9 | * @author mingJie 10 | */ 11 | public interface MarkConditionParser extends DBTypeLabel { 12 | 13 | /** 14 | * 处理具体的condition 15 | * @param condition 16 | */ 17 | void process(T condition); 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/parser/TableInfoParser.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.parser; 2 | 3 | import com.javaoffers.brief.modelhelper.utils.DBTypeLabel; 4 | import com.javaoffers.brief.modelhelper.utils.TableInfo; 5 | 6 | import java.sql.Connection; 7 | 8 | /** 9 | * 解析TableInfo. 不同的DB会有不同的解析. 10 | * @author mingJie 11 | */ 12 | public interface TableInfoParser extends DBTypeLabel { 13 | 14 | /** 15 | * 解析TableInfo 16 | * @param connection 17 | * @param tableInfo 18 | */ 19 | void parseTableInfo(Connection connection, TableInfo tableInfo); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/CglibProxyProcess.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | import net.sf.cglib.proxy.MethodProxy; 4 | 5 | import java.lang.reflect.Method; 6 | 7 | @FunctionalInterface 8 | public interface CglibProxyProcess { 9 | /** 10 | * @param proxyObject proxyObject 11 | * @param obj realObject 12 | * @param method proxyMethod 13 | * @param args args 14 | * @param proxy call invoke real methods 15 | * @return 16 | * @throws Throwable 17 | */ 18 | public Object intercept(Object proxyObject, Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable; 19 | } 20 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/ColumnInfo.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | /** 4 | * @Description: Field information 5 | * @Auther: create by cmj on 2022/5/4 01:48 6 | */ 7 | public class ColumnInfo { 8 | 9 | private String colNamme; 10 | 11 | public ColumnInfo(String colNamme) { 12 | this.colNamme = colNamme; 13 | } 14 | 15 | public String getColNamme() { 16 | return colNamme; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/ColumnLabel.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | /** 4 | * database column label. 5 | * @author create by mingjie 6 | */ 7 | public interface ColumnLabel { 8 | 9 | /** 10 | * mysql 11 | */ 12 | String COLUMN_NAME = "COLUMN_NAME"; 13 | /** 14 | * mysql 15 | */ 16 | String TYPE_NAME = "TYPE_NAME"; 17 | /** 18 | * mysql 19 | */ 20 | String IS_AUTOINCREMENT = "IS_AUTOINCREMENT"; 21 | /** 22 | * mysql 23 | */ 24 | String COLUMN_DEF = "COLUMN_DEF"; 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/CommonExecutor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | import java.util.concurrent.ExecutorService; 4 | import java.util.concurrent.Executors; 5 | import java.util.concurrent.ScheduledExecutorService; 6 | 7 | /** 8 | * @author mingJie 9 | */ 10 | public class CommonExecutor { 11 | public static final ScheduledExecutorService oneFixedScheduledThreadPool = Executors.newSingleThreadScheduledExecutor(); 12 | } 13 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/DBTypeLabel.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public interface DBTypeLabel { 7 | DBType getDBType(); 8 | } 9 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/FieldNameAnnoInfo.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public class FieldNameAnnoInfo { 7 | private String fieldName; 8 | private boolean excludeColAll; 9 | 10 | public String getFieldName() { 11 | return fieldName; 12 | } 13 | 14 | public void setFieldName(String fieldName) { 15 | this.fieldName = fieldName; 16 | } 17 | 18 | public boolean isExcludeColAll() { 19 | return excludeColAll; 20 | } 21 | 22 | public void setExcludeColAll(boolean excludeColAll) { 23 | this.excludeColAll = excludeColAll; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/Getter.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | 5 | /** 6 | * @description: 7 | * @author: create by cmj on 2023/7/30 23:53 8 | */ 9 | public interface Getter extends GetterFun { 10 | U getter(T t); 11 | } 12 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/GsonUtils.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | import com.google.gson.Gson; 4 | 5 | /** 6 | * @author mingJie 7 | */ 8 | public class GsonUtils { 9 | public static final Gson gson = new Gson(); 10 | } 11 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/Newc.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | /** 4 | * @description: 5 | * @author: create by cmj on 2023/7/30 11:00 6 | */ 7 | @FunctionalInterface 8 | public interface Newc { 9 | T newc(); 10 | } 11 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/ProxyProcess.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | /** 6 | * @description: for jdk proxy process 7 | * @author: create by cmj on 2023/5/28 00:40 8 | */ 9 | @FunctionalInterface 10 | public interface ProxyProcess { 11 | /** 12 | * 13 | * @param instance 真是对象, 非代理对象 14 | * @param method 调用的方法 15 | * @param args 调用参数 16 | * @return 17 | */ 18 | public Object doInvoke(Object instance, Method method, Object[] args); 19 | } 20 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/SQLType.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public enum SQLType { 7 | 8 | /** 9 | * JOIN QUERY. 10 | */ 11 | JOIN_SELECT, 12 | /** 13 | * Ordinary query 14 | */ 15 | NORMAL_SELECT, 16 | 17 | /** 18 | * DML: for example 19 | * CREATE 20 | * ALTER 21 | * DROP 22 | * TRUNCATE 23 | * COMMENT 24 | * RENAME 25 | */ 26 | DDL, 27 | 28 | /** 29 | * DML: for example 30 | * EXPLAIN PLAN 31 | */ 32 | DML, 33 | } 34 | -------------------------------------------------------------------------------- /brief-common/src/main/java/com/javaoffers/brief/modelhelper/utils/Setter.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.utils; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | @FunctionalInterface 7 | public interface Setter { 8 | 9 | void setter(T t, U value); 10 | } 11 | -------------------------------------------------------------------------------- /brief-common/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger = DEBUG, console 2 | log4j.appender.console=org.apache.log4j.ConsoleAppender 3 | log4j.appender.console.target=System.out 4 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n 6 | 7 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/core/CrudMapperConstant.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core; 2 | 3 | /** 4 | * @Description: About BriefMapper interface method description 5 | * @Auther: create by cmj on 2022/5/3 13:31 6 | */ 7 | public enum CrudMapperConstant { 8 | 9 | SELECT(1,"select"), 10 | 11 | UPDATE(2,"update"), 12 | 13 | DELETE(3,"delete"), 14 | 15 | INSERT(4,"insert"), 16 | 17 | GENERAL(5,"general"), 18 | ; 19 | 20 | 21 | private int code; 22 | private String methodName; 23 | 24 | CrudMapperConstant(int code, String methodName) { 25 | this.code = code; 26 | this.methodName = methodName; 27 | } 28 | 29 | public int getCode() { 30 | return code; 31 | } 32 | 33 | public String getMethodName() { 34 | return methodName; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/AggTag.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | /** 4 | * @Description: 聚合函数标签(支持单参数函数) 5 | * @Auther: create by cmj on 2022/6/5 17:17 6 | */ 7 | public enum AggTag { 8 | /**聚合函数**/ 9 | AVG,//(表达式) 返回表达式中所有的平均值。仅用于数字列并自动忽略NULL值。 10 | COUNT,//(表达式) 返回表达式中非NULL值的数量。可用于数字和字符列。 11 | MAX,//(表达式) 返回表达式中的最大值,忽略NULL值。可用于数字、字符和日期时间列。 12 | MIN,//(表达式) 返回表达式中的最小值,忽略NULL值。可用于数字、字符和日期时间列。 13 | SUM,//(表达式) 返回表达式中所有的总和,忽略NULL值。仅用于数字列。 14 | } 15 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/ExecutFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | /** 4 | * @Description: 执行sql 5 | * @Auther: create by cmj on 2022/5/2 23:08 6 | */ 7 | public interface ExecutFun extends ExecutOneFun,ExecutMoreFun{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/ExecutMoreFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @Description: 执行sql 返回列表 7 | * @Auther: create by cmj on 2022/5/8 20:44 8 | */ 9 | public interface ExecutMoreFun { 10 | 11 | /** 12 | * 执行sql 返回 List 13 | * @return 14 | */ 15 | public List exs(); 16 | } 17 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/ExecutOneFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | /** 4 | * @Description: 执行sql 5 | * @Auther: create by cmj on 2022/5/8 20:43 6 | */ 7 | public interface ExecutOneFun { 8 | /** 9 | * 执行sql 返回 M. 10 | * @return 11 | */ 12 | public M ex(); 13 | } 14 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/HeadEnum.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | /** 4 | * desc: Tag information. 5 | * 6 | * @author cao ming jie create by 2025/10/3 7 | */ 8 | public enum HeadEnum { 9 | LIMIT, 10 | ORDERS 11 | } 12 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/StreamingFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun; 2 | 3 | import java.util.function.Consumer; 4 | 5 | /** 6 | * Streaming queries. Avoid OOM. 7 | * TIP: Try not to perform join queries. If you use join queries, please remember to sort by the main table id. 8 | * Otherwise, data aggregation problems will occur 9 | * @param 10 | */ 11 | public interface StreamingFun { 12 | 13 | /** 14 | * if empty then return 0. 15 | * @param consumer consumer 16 | * @return num 17 | */ 18 | int stream(Consumer consumer); 19 | } 20 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/IgnoreAndOrWordCondition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition; 2 | 3 | /** 4 | * @Description: 忽略 拼接关键字。 5 | * @Auther: create by cmj on 2022/6/19 02:26 6 | */ 7 | public interface IgnoreAndOrWordCondition { 8 | } 9 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/insert/InsertCondition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.insert; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.Condition; 4 | 5 | public interface InsertCondition extends Condition { 6 | String getValuesSql(); 7 | } 8 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/mark/OnConditionMark.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.mark; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.Condition; 4 | import com.javaoffers.brief.modelhelper.fun.ConditionTag; 5 | 6 | import java.util.Collections; 7 | import java.util.Map; 8 | 9 | /** 10 | * @Description: on标记 11 | * @Auther: create by cmj on 2022/5/22 16:18 12 | */ 13 | public class OnConditionMark implements Condition { 14 | @Override 15 | public ConditionTag getConditionTag() { 16 | return ConditionTag.ON; 17 | } 18 | 19 | @Override 20 | public String getSql() { 21 | return ConditionTag.ON.getTag(); 22 | } 23 | 24 | @Override 25 | public Map getParams() { 26 | return Collections.EMPTY_MAP; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/mark/ReplaceIntoMark.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.mark; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.Condition; 4 | import com.javaoffers.brief.modelhelper.fun.ConditionTag; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | /** 10 | * @description: 11 | * @author: create by cmj on 2022/11/19 18:22 12 | */ 13 | public class ReplaceIntoMark implements Condition { 14 | @Override 15 | public ConditionTag getConditionTag() { 16 | return ConditionTag.REPLACE_INTO; 17 | } 18 | 19 | @Override 20 | public String getSql() { 21 | return getConditionTag().getTag(); 22 | } 23 | 24 | @Override 25 | public Map getParams() { 26 | return new HashMap<>(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/mark/WhereConditionMark.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.mark; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.Condition; 4 | import com.javaoffers.brief.modelhelper.fun.ConditionTag; 5 | 6 | import java.util.Collections; 7 | import java.util.Map; 8 | 9 | /** 10 | * @Description: where标记 11 | * @Auther: create by cmj on 2022/5/22 16:18 12 | */ 13 | public class WhereConditionMark implements Condition { 14 | @Override 15 | public ConditionTag getConditionTag() { 16 | return ConditionTag.WHERE; 17 | } 18 | 19 | @Override 20 | public String getSql() { 21 | return ConditionTag.WHERE.getTag(); 22 | } 23 | 24 | @Override 25 | public Map getParams() { 26 | return Collections.EMPTY_MAP; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/update/UpdateColValueCondition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.update; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | import com.javaoffers.brief.modelhelper.fun.condition.ColValueCondition; 5 | 6 | public class UpdateColValueCondition extends ColValueCondition { 7 | 8 | public UpdateColValueCondition(GetterFun colNameGetterFun, Object value) { 9 | super(colNameGetterFun, value); 10 | } 11 | 12 | @Override 13 | public String getSql() { 14 | return getExpressionColName() + " = #{" + this.getColName() +"} "; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/update/UpdateCondition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.update; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.Condition; 4 | import com.javaoffers.brief.modelhelper.fun.HeadCondition; 5 | 6 | /** 7 | * @author create by cmj 8 | */ 9 | public interface UpdateCondition extends Condition { 10 | 11 | void setHeadCondition(HeadCondition headCondition); 12 | } 13 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/where/AddPatchMarkCondition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.where; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.Condition; 4 | import com.javaoffers.brief.modelhelper.fun.ConditionTag; 5 | 6 | import java.util.Collections; 7 | import java.util.Map; 8 | 9 | /** 10 | * 这的数据前部为空实现,只是用于做标记 11 | */ 12 | public class AddPatchMarkCondition implements Condition { 13 | 14 | @Override 15 | public ConditionTag getConditionTag() { 16 | return ConditionTag.BLANK; 17 | } 18 | 19 | @Override 20 | public String getSql() { 21 | return ConditionTag.BLANK.getTag(); 22 | } 23 | 24 | @Override 25 | public Map getParams() { 26 | return Collections.emptyMap(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/where/ExistsCondition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.where; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.ConditionTag; 4 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 5 | 6 | /** 7 | * @Description: exists sql 语句 8 | * @Auther: create by cmj on 2022/5/3 02:54 9 | */ 10 | public class ExistsCondition extends WhereOnCondition { 11 | 12 | private String sql; 13 | 14 | public ExistsCondition(GetterFun existsSql) { 15 | super(existsSql, null, ConditionTag.EXISTS); 16 | } 17 | 18 | @Override 19 | public String getSql() { 20 | if(sql == null){ 21 | sql = " "+getTag().getTag()+" ( "+ this.getColName()+" ) "; 22 | } 23 | return sql; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/where/IsNullOrCondition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.where; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.ConditionTag; 4 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 5 | 6 | import java.util.Collections; 7 | import java.util.Map; 8 | 9 | public class IsNullOrCondition extends WhereOnCondition { 10 | 11 | public IsNullOrCondition(GetterFun colName, ConditionTag tag) { 12 | super(colName, null, tag); 13 | } 14 | 15 | @Override 16 | public String getSql() { 17 | return getColName() + getTag().getTag(); 18 | } 19 | 20 | @Override 21 | public Map getParams() { 22 | return Collections.EMPTY_MAP; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/where/LFCondition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.where; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.ConditionTag; 4 | 5 | /** 6 | * @Description: 左括号 7 | * @Auther: create by cmj on 2022/6/19 02:11 8 | */ 9 | public class LFCondition extends WhereOnCondition { 10 | 11 | private ConditionTag tag; 12 | 13 | public LFCondition(ConditionTag tag) { 14 | this.tag = tag; 15 | } 16 | 17 | @Override 18 | public String getSql() { 19 | return tag.getTag(); 20 | } 21 | 22 | @Override 23 | public ConditionTag getTag() { 24 | return tag; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/where/NativeSQLCondition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.where; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.condition.IgnoreAndOrWordCondition; 4 | 5 | import java.util.Map; 6 | 7 | public class NativeSQLCondition extends CondSQLCondition implements IgnoreAndOrWordCondition { 8 | 9 | public NativeSQLCondition(String sql, Map params) { 10 | super(sql, params); 11 | } 12 | 13 | public NativeSQLCondition(String sql) { 14 | super(sql); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/condition/where/WhereCondition.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.condition.where; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.Condition; 4 | import com.javaoffers.brief.modelhelper.fun.HeadCondition; 5 | 6 | /** 7 | * @description: 8 | * @author: create by cmj on 2022/10/22 09:37 9 | */ 10 | public interface WhereCondition extends Condition { 11 | 12 | public void setHeadCondition(HeadCondition headCondition); 13 | 14 | public void setAndOrTag(String andOrTag); 15 | 16 | public String getAndOrTag(); 17 | 18 | public long getNextLong(); 19 | 20 | public String getNextTag(); 21 | 22 | public void cleanAndOrTag(); 23 | 24 | public String getColName(); 25 | 26 | public void setColName(String colName); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/GroupFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | /** 4 | * @Description: 支持分组. 5 | * @Auther: create by cmj on 2022/6/5 18:10 6 | */ 7 | public interface GroupFun > { 8 | R groupBy(C... c); 9 | 10 | R groupBy(String... c); 11 | } 12 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/HavingPendingFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.ExecutFun; 4 | 5 | /** 6 | * @Description: 7 | * @Auther: create by cmj on 2022/6/5 18:18 8 | */ 9 | public interface HavingPendingFun> extends ExecutFun, 10 | OrderFun> { 11 | 12 | HavingPendingFun groupBy(C... c); 13 | 14 | HavingPendingFun groupBy(String... c); 15 | 16 | HavingFun having(); 17 | 18 | HavingPendingFun limitPage(int pageNum, int size); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/JoinFunTableExtend.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | 5 | public interface JoinFunTableExtend,V> { 6 | 7 | JoinFun tablePrefix(String tablePrefix); 8 | 9 | JoinFun tableSuffix(String tableSuffix); 10 | } 11 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/LastJoinFunTableExtend.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | 5 | public interface LastJoinFunTableExtend,V> { 6 | 7 | LastJoinFun tablePrefix(String tablePrefix); 8 | 9 | LastJoinFun tableSuffix(String tableSuffix); 10 | } 11 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/LeftGroupFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GGetterFun; 4 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 5 | 6 | /** 7 | * @Description: 支持分组. 8 | * @Auther: create by cmj on 2022/6/5 18:10 9 | */ 10 | public interface LeftGroupFun, C2 extends GGetterFun, V, R extends LeftHavingPendingFun> { 11 | R groupBy(C... c); 12 | R groupBy(C2... c); 13 | } 14 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/LeftHavingPendingFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.ExecutFun; 4 | 5 | /** 6 | * @Description: 7 | * @Auther: create by cmj on 2022/6/12 18:40 8 | */ 9 | public interface LeftHavingPendingFun extends ExecutFun { 10 | HavingFun having(); 11 | 12 | } -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/LimitFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.ExecutFun; 4 | 5 | /** 6 | * @Description: limit sql . 7 | * @Auther: create by cmj on 2022/6/11 17:26 8 | */ 9 | public interface LimitFun extends ExecutFun { 10 | 11 | /** 12 | * 分页 13 | * @param pageNum 第几页 14 | * @param size 每页条数 15 | * @return 数据 16 | */ 17 | R limitPage(int pageNum, int size); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/OnFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.ExecutFun; 4 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 5 | import com.javaoffers.brief.modelhelper.fun.StreamingFun; 6 | 7 | /** 8 | * @Description: on 拼接sql 条件 9 | * @Auther: create by cmj on 2022/5/2 00:56 10 | * sql: selct xx from a left join b on a.col = b.col 11 | */ 12 | public interface OnFun > extends 13 | SmartOnFun, GetterFun, V, R >, 14 | StreamingFun { 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/OrderFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2022/6/19 02:44 6 | */ 7 | public interface OrderFun { 8 | 9 | /** 10 | * 根据某些字段排序 ASC 11 | * @param cs 12 | * @return 13 | */ 14 | public R orderA(C... cs); 15 | 16 | /** 17 | * 根据某些字段排序 ASC 18 | * @param cs 19 | * @return 20 | */ 21 | public R orderA(boolean condition, C... cs); 22 | 23 | /** 24 | * 根据某些字段排序 DESC 25 | * @param cs 26 | * @return 27 | */ 28 | public R orderD(C... cs); 29 | 30 | /** 31 | * 根据某些字段排序 DESC 32 | * @param cs 33 | * @return 34 | */ 35 | public R orderD(boolean condition, C... cs); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/SmartSelectFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | 5 | /** 6 | * @Description: 查询 7 | * @Auther: create by cmj on 2022/5/1 23:58 8 | * M: model 类 9 | * C: 字段, 10 | * V: 字段值 11 | */ 12 | public interface SmartSelectFun , V, R> 13 | extends BaseSelectFun, ToJoinFun { 14 | /** 15 | * sql 语句: where 16 | * @return 17 | */ 18 | public WhereSelectFun where(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/WhereModifyFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.ExecutOneFun; 4 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 5 | import com.javaoffers.brief.modelhelper.fun.crud.update.SmartUpdateFun; 6 | 7 | /** 8 | * @Description: where 9 | * @Auther: create by cmj on 2022/5/4 21:44 10 | */ 11 | public interface WhereModifyFun extends WhereFun,V, WhereModifyFun> , ExecutOneFun { 12 | 13 | /** 14 | * add patch 15 | * @return 16 | */ 17 | SmartUpdateFun, V> addBatch(); 18 | } 19 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/WhereSelectFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.ExecutFun; 4 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 5 | import com.javaoffers.brief.modelhelper.fun.StreamingFun; 6 | 7 | /** 8 | * @Description: select where 条件 9 | * @Auther: create by cmj on 2022/5/4 21:37 10 | */ 11 | public interface WhereSelectFun extends 12 | WhereFun,V, WhereSelectFun> , 13 | GroupFun,V, HavingPendingFun,V, ?>>, 14 | OrderFun,V, WhereSelectFun>, 15 | LimitFun>, 16 | StreamingFun, 17 | ExecutFun { 18 | } 19 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/delete/DeleteFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud.delete; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | 5 | public interface DeleteFun, V> { 6 | 7 | /** 8 | * sql 语句: where 9 | * @return 10 | */ 11 | public DeleteWhereFun where(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/delete/DeleteWhereFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud.delete; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.ExecutOneFun; 4 | import com.javaoffers.brief.modelhelper.fun.crud.WhereFun; 5 | 6 | /** 7 | * @Description: 8 | * @Auther: create by cmj on 2022/7/10 01:21 9 | */ 10 | public interface DeleteWhereFun extends WhereFun>, ExecutOneFun { 11 | } 12 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/insert/InsertFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud.insert; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | 5 | /** 6 | * 插入功能. 7 | * 8 | * @author cmj 9 | */ 10 | public interface InsertFun, V> extends OneInsertCol, SmartMoreInsertColAll { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/insert/OneInsertCol.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud.insert; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | 5 | public interface OneInsertCol , V> { 6 | /** 7 | * Specify a specific field to insert 8 | * 9 | * @param col field 10 | * @param value value 11 | * @return this 12 | */ 13 | OneInsertFun col(C col, V value); 14 | 15 | /** 16 | * Specify a specific field to insert 17 | * 18 | * @param condition if true then insert 19 | * @param col field 20 | * @param value value 21 | * @return this 22 | */ 23 | OneInsertFun col(boolean condition, C col, V value); 24 | } 25 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/update/MoreUpdateFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud.update; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | 5 | /** 6 | * batch update 7 | * @author cmj 8 | */ 9 | public interface MoreUpdateFun , V> { 10 | 11 | 12 | /** 13 | * update all Col . include null value 14 | * @param model 15 | * @return 16 | */ 17 | PrepareWhereModifyFun colAll(M model); 18 | 19 | /** 20 | * update all Col . include null value 21 | * @param condition true will update 22 | * @param model allCol 23 | * @return 24 | */ 25 | PrepareWhereModifyFun colAll(boolean condition , M model); 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/update/OneUpdateCol.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud.update; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | 5 | public interface OneUpdateCol, V> { 6 | 7 | /** 8 | * updated field. 9 | * @param col colName 10 | * @param value value 11 | * @return this 12 | */ 13 | OneUpdateFun col(C col, V value); 14 | 15 | /** 16 | * updated field. 17 | * @param condition true will update this col 18 | * @param col colName 19 | * @param value value 20 | * @return this 21 | */ 22 | OneUpdateFun col(boolean condition, C col, V value); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/update/OneUpdateFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud.update; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | import com.javaoffers.brief.modelhelper.fun.crud.WhereModifyFun; 5 | 6 | /** 7 | * @author create by cmj on 2022-06-29 8 | */ 9 | public interface OneUpdateFun , V> extends OneUpdateCol{ 10 | 11 | /** 12 | * where 13 | * @return 14 | */ 15 | WhereModifyFun where(); 16 | } 17 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/update/PrepareWhereModifyFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud.update; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | import com.javaoffers.brief.modelhelper.fun.crud.WhereModifyFun; 5 | 6 | public interface PrepareWhereModifyFun , V> { 7 | 8 | /** 9 | * where 10 | * @return 11 | */ 12 | WhereModifyFun where(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/update/SmartUpdateFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud.update; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | 5 | /** 6 | * @author create by cmj on 2022-06-29 7 | */ 8 | public interface SmartUpdateFun, V> extends OneUpdateCol, MoreUpdateFun { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/fun/crud/update/UpdateFun.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.fun.crud.update; 2 | 3 | import com.javaoffers.brief.modelhelper.fun.GetterFun; 4 | 5 | /** 6 | * @author create by cmj on 2022-06-29 7 | */ 8 | public interface UpdateFun, V> { 9 | 10 | /** 11 | * uodate include null col 12 | * @return 13 | */ 14 | SmartUpdateFun updateNull(); 15 | 16 | /** 17 | * update exclude null col 18 | * @return 19 | */ 20 | SmartUpdateFun npdateNull(); 21 | } 22 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/jdbc/BriefJdbcExecutorFactory.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.jdbc; 2 | 3 | import javax.sql.DataSource; 4 | 5 | /** 6 | * @author mingJie 7 | */ 8 | public class BriefJdbcExecutorFactory implements JdbcExecutorFactory { 9 | 10 | public static final BriefJdbcExecutorFactory instance = new BriefJdbcExecutorFactory(); 11 | 12 | @Override 13 | public JdbcExecutor createJdbcExecutor(DataSource dataSource, Class modelClass) { 14 | return new BriefJdbcExecutor(dataSource, modelClass); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /brief-core/src/main/java/com/javaoffers/brief/modelhelper/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaoffers/briefest/962b0c3308f2792a81b409c9aa01846ab10d3ee4/brief-core/src/main/java/com/javaoffers/brief/modelhelper/readme.md -------------------------------------------------------------------------------- /brief-encipher/src/main/java/com/javaoffers/brief/modelhelper/encrypt/EncryptConfigConst.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.encrypt; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public class EncryptConfigConst { 7 | 8 | public static final String KEY = "key"; 9 | 10 | public static final String TABLE_NAME = "tableName"; 11 | 12 | public static final String COLUMNS = "columns"; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /brief-encipher/src/main/java/com/javaoffers/brief/modelhelper/encrypt/JqlAesInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.encrypt; 2 | 3 | import com.javaoffers.brief.modelhelper.context.JqlInterceptor; 4 | 5 | public interface JqlAesInterceptor extends JqlInterceptor { 6 | } 7 | -------------------------------------------------------------------------------- /brief-encipher/src/main/java/com/javaoffers/brief/modelhelper/encrypt/SqlAesProcessor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.encrypt; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public interface SqlAesProcessor { 7 | /** 8 | * parsing sql 9 | * @param sql 10 | * @return 11 | */ 12 | String parseSql(String sql) ; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper; 2 | 3 | 4 | /** 5 | * Unit test for simple App. 6 | */ 7 | public class AppTest 8 | { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Boolean2StringConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | public class Boolean2StringConvert extends AbstractConver { 4 | @Override 5 | public String convert(Boolean aBoolean) { 6 | 7 | return aBoolean.toString(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/ByteArray2StringConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | public class ByteArray2StringConvert extends AbstractConver { 4 | @Override 5 | public String convert(byte[] bytes) { 6 | return new String(bytes); 7 | } 8 | } 9 | 10 | class ByteArray2StringConvert2 extends AbstractConver { 11 | @Override 12 | public String convert(Byte[] bytes) { 13 | byte[] bs = new byte[bytes.length]; 14 | if(bytes.length>0){ 15 | int i = 0; 16 | for(Byte b : bytes){ 17 | bs[i] = b; 18 | i++; 19 | } 20 | } 21 | return new String(bs); 22 | } 23 | 24 | public ByteArray2StringConvert2() { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Character2StringConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | public class Character2StringConvert extends AbstractConver { 4 | @Override 5 | public String convert(Character character) { 6 | return character.toString(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Convert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/7 19:53 6 | */ 7 | public interface Convert { 8 | /** 9 | * 将 T 转换为V 10 | * @param t 11 | * @return 12 | */ 13 | V convert (T t); 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Date2LocalDateConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import com.javaoffers.brief.modelhelper.util.DateUtils; 4 | 5 | import java.time.LocalDate; 6 | import java.util.Date; 7 | 8 | public class Date2LocalDateConvert extends AbstractConver { 9 | 10 | @Override 11 | public LocalDate convert(Date date) { 12 | return DateUtils.parseLocalDate(date); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Date2LocalDateTimeConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import com.javaoffers.brief.modelhelper.util.DateUtils; 4 | 5 | import java.time.LocalDateTime; 6 | import java.util.Date; 7 | 8 | public class Date2LocalDateTimeConvert extends AbstractConver { 9 | @Override 10 | public LocalDateTime convert(Date date) { 11 | return DateUtils.parseLocalDateTime(date); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Date2LongConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import java.util.Date; 4 | 5 | public class Date2LongConvert extends AbstractConver { 6 | @Override 7 | public Long convert(Date date) { 8 | return date.getTime(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Date2OffsetDateTimeConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import com.javaoffers.brief.modelhelper.util.DateUtils; 4 | 5 | import java.time.OffsetDateTime; 6 | import java.util.Date; 7 | 8 | public class Date2OffsetDateTimeConvert extends AbstractConver { 9 | @Override 10 | public OffsetDateTime convert(Date date) { 11 | return DateUtils.parseOffsetDateTime(date); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Date2StringConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import org.apache.commons.lang3.time.DateFormatUtils; 4 | 5 | import java.util.Date; 6 | 7 | public class Date2StringConvert extends AbstractConver { 8 | 9 | @Override 10 | public String convert(Date date) { 11 | return DateFormatUtils.format(date,"yyyy-MM-dd HH:mm:ss"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/LocalDate2StringConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import java.time.LocalDate; 4 | 5 | /** 6 | * 将localDate 转换为String 7 | */ 8 | public class LocalDate2StringConvert extends AbstractConver { 9 | @Override 10 | public String convert(LocalDate localDate) { 11 | return localDate.toString(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/LocalDateTime2DateConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import com.javaoffers.brief.modelhelper.util.DateUtils; 4 | 5 | import java.time.ZonedDateTime; 6 | import java.time.LocalDateTime; 7 | import java.time.ZoneId; 8 | import java.util.Date; 9 | 10 | public class LocalDateTime2DateConvert extends AbstractConver { 11 | 12 | @Override 13 | public Date convert(LocalDateTime localDateTime) { 14 | return DateUtils.toDate(localDateTime); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/LocalDateTime2StringConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import com.javaoffers.brief.modelhelper.util.DateUtils; 4 | import org.apache.commons.lang3.time.DateFormatUtils; 5 | 6 | import java.time.LocalDateTime; 7 | import java.util.Date; 8 | 9 | public class LocalDateTime2StringConvert extends AbstractConver { 10 | static Date2StringConvert date2StringConvert = new Date2StringConvert(); 11 | @Override 12 | public String convert(LocalDateTime localDateTime) { 13 | return date2StringConvert.convert(DateUtils.toDate(localDateTime)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Number2LocalDateConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import java.time.LocalDate; 4 | import java.util.Date; 5 | 6 | public class Number2LocalDateConvert extends AbstractConver { 7 | @Override 8 | public LocalDate convert(Number number) { 9 | Date date = new Date(number.longValue()); 10 | return LocalDate.of(date.getYear()+ 1900,date.getMonth()+1,date.getDate()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Number2LocalDateTimeConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import java.time.LocalDateTime; 4 | import java.util.Date; 5 | 6 | public class Number2LocalDateTimeConvert extends AbstractConver { 7 | @Override 8 | public LocalDateTime convert(Number number) { 9 | Date date = new Date(number.longValue()); 10 | return LocalDateTime.of(date.getYear()+1900 11 | ,date.getMonth()+1 12 | ,date.getDate() 13 | ,date.getHours() 14 | ,date.getMinutes() 15 | ,date.getSeconds()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Number2SQLDateConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import java.sql.Date; 4 | 5 | public class Number2SQLDateConvert extends AbstractConver { 6 | @Override 7 | public Date convert(Number number) { 8 | return new Date(number.longValue()); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/Number2VersionConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import com.javaoffers.brief.modelhelper.anno.derive.flag.Version; 4 | import org.apache.commons.lang3.time.DateFormatUtils; 5 | 6 | import java.util.Date; 7 | 8 | public class Number2VersionConvert extends AbstractConver { 9 | 10 | @Override 11 | public Version convert(Number number) { 12 | return new Version(number); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2BigDecimalConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import java.math.BigDecimal; 4 | 5 | /** 6 | * @Description: String2BigDecimalConvert 7 | * @Auther: create by cmj on 2021/12/10 12:59 8 | */ 9 | public class String2BigDecimalConvert extends AbstractConver { 10 | @Override 11 | public BigDecimal convert(String s) { 12 | return new BigDecimal(s); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2BigIntegerConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import java.math.BigInteger; 4 | 5 | /** 6 | * @Description: String2BigIntegerConvert 7 | * @Auther: create by cmj on 2021/12/10 13:00 8 | */ 9 | public class String2BigIntegerConvert extends AbstractConver { 10 | @Override 11 | public BigInteger convert(String s) { 12 | return new BigInteger(s); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2BooleanConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | 5 | /** 6 | * @Description: String2BooleanConvert 7 | * @Auther: create by cmj on 2021/12/10 12:17 8 | */ 9 | public class String2BooleanConvert extends AbstractConver { 10 | @Override 11 | public Boolean convert(String bool) { 12 | return StringUtils.isBlank(bool) ? false : bool.trim().equalsIgnoreCase("true"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2ByteConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | /** 4 | * @Description: String2ByteConvert 5 | * @Auther: create by cmj on 2021/12/10 12:17 6 | */ 7 | public class String2ByteConvert extends AbstractConver { 8 | @Override 9 | public Byte convert(String s) { 10 | byte b = Byte.parseByte(s); 11 | return b; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2CharConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/10 12:49 6 | */ 7 | public class String2CharConvert extends AbstractConver { 8 | @Override 9 | public Character convert(String s) { 10 | return new Character(s.toCharArray()[0]); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2DoubleConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/10 12:58 6 | */ 7 | public class String2DoubleConvert extends AbstractConver { 8 | @Override 9 | public Double convert(String s) { 10 | return Double.parseDouble(s); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2FloatConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/10 12:57 6 | */ 7 | public class String2FloatConvert extends AbstractConver { 8 | 9 | @Override 10 | public Float convert(String s) { 11 | return Float.parseFloat(s); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2IntegerConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/10 12:18 6 | */ 7 | public class String2IntegerConvert extends AbstractConver { 8 | @Override 9 | public Integer convert(String s) { 10 | return Integer.parseInt(s); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2LocalDateConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import java.time.LocalDate; 4 | import java.util.Date; 5 | 6 | /** 7 | * @Description: String2LocalDateConvert 8 | * @Auther: create by cmj on 2021/12/10 13:16 9 | */ 10 | public class String2LocalDateConvert extends AbstractConver { 11 | 12 | @Override 13 | public LocalDate convert(String s) { 14 | Date date = String2DateConvert.convert2(s); 15 | return LocalDate.of(date.getYear()+1900,date.getMonth()+1,date.getDate()); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2LocalDateTimeConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import java.time.LocalDateTime; 4 | import java.util.Date; 5 | 6 | /** 7 | * @Description: String2LocalDateTimeConvert 8 | * @Auther: create by cmj on 2021/12/10 13:33 9 | */ 10 | public class String2LocalDateTimeConvert extends AbstractConver { 11 | @Override 12 | public LocalDateTime convert(String s) { 13 | Date date = String2DateConvert.convert2(s); 14 | return LocalDateTime.of( 15 | date.getYear()+1900 16 | ,date.getMonth()+1 17 | ,date.getDate() 18 | ,date.getHours() 19 | ,date.getMinutes() 20 | ,date.getSeconds() 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2LongConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/10 12:56 6 | */ 7 | public class String2LongConvert extends AbstractConver { 8 | @Override 9 | public Long convert(String s) { 10 | return Long.parseLong(s); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2OffsetDateTimeConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import com.javaoffers.brief.modelhelper.util.DateUtils; 4 | 5 | import java.time.OffsetDateTime; 6 | import java.util.Date; 7 | 8 | public class String2OffsetDateTimeConvert extends AbstractConver { 9 | 10 | @Override 11 | public OffsetDateTime convert(String s) { 12 | Date date = String2DateConvert.convert2(s); 13 | return DateUtils.parseOffsetDateTime(date); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2SQLDateConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | import java.sql.Date; 4 | 5 | /** 6 | * @Description: 7 | * @Auther: create by cmj on 2021/12/10 13:11 8 | */ 9 | public class String2SQLDateConvert extends AbstractConver { 10 | static String2DateConvert dateConvert = new String2DateConvert(); 11 | @Override 12 | public Date convert(String s) { 13 | java.util.Date convert = dateConvert.convert(s); 14 | return new Date(convert.getTime()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/convert/String2ShortConvert.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.convert; 2 | 3 | /** 4 | * @Description: String2ShortConvert 5 | * @Auther: create by cmj on 2021/12/10 12:52 6 | */ 7 | public class String2ShortConvert extends AbstractConver { 8 | @Override 9 | public Short convert(String s) { 10 | return Short.parseShort(s); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/core/ConverDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/8 13:00 6 | */ 7 | 8 | public class ConverDescriptor implements Descriptor{ 9 | 10 | private Class src; 11 | private Class des; 12 | private String um; 13 | 14 | @Override 15 | public String getUniqueMark() { 16 | return um; 17 | } 18 | 19 | public ConverDescriptor(Class src, Class des) { 20 | this.src = src; 21 | this.des = des; 22 | this.um = src.getName()+"#"+des.getName(); 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/core/Descriptor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/8 13:03 6 | */ 7 | public interface Descriptor { 8 | 9 | public String getUniqueMark(); 10 | } 11 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/core/Register.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core; 2 | 3 | import com.javaoffers.brief.modelhelper.convert.Convert; 4 | 5 | /** 6 | * 注册器 7 | */ 8 | public interface Register { 9 | /** 10 | * 注册选择器 11 | * @param descriptor 12 | */ 13 | public void registerConvert(D descriptor, C convert); 14 | } 15 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/core/Selector.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core; 2 | 3 | /** 4 | * @Description: 5 | * @Auther: create by cmj on 2021/12/7 18:23 6 | */ 7 | public interface Selector { 8 | 9 | /** 10 | * 根据T 选择V 11 | * @return 12 | */ 13 | V selector(T t); 14 | } 15 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/core/SelectorRegister.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.core; 2 | 3 | import com.javaoffers.brief.modelhelper.convert.Convert; 4 | 5 | /** 6 | * @Description: 7 | * @Auther: create by cmj on 2021/12/7 20:08 8 | */ 9 | public interface SelectorRegister extends Selector ,Register{ 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /brief-helper/src/main/java/com/javaoffers/brief/modelhelper/parse/ModelParse.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.parse; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | /** 8 | * @Description: 9 | * @Auther: create by cmj on 2021/12/7 19:57 10 | */ 11 | public interface ModelParse { 12 | 13 | /** 14 | * 模型解析 15 | * @param clazz 16 | * @param listMap 17 | * @param 18 | * @return 19 | */ 20 | public List converterMap2Model(Class clazz, List> listMap); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/constant/ManLevel.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.constant; 2 | 3 | import com.javaoffers.brief.modelhelper.anno.EnumValue; 4 | 5 | /** 6 | * @description: 7 | * @author: create by cmj on 2023/1/2 14:41 8 | */ 9 | public enum ManLevel { 10 | RICH(10,"rich"), 11 | POOR(11,"poor") 12 | ; 13 | private int code; 14 | @EnumValue 15 | private String mes; 16 | ManLevel(int code, String mes){ 17 | this.code = code; 18 | this.mes = mes; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/constant/Month.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.constant; 2 | 3 | import com.javaoffers.brief.modelhelper.anno.EnumValue; 4 | 5 | /** 6 | * @description: 7 | * @author: create by cmj on 2023/1/2 15:39 8 | */ 9 | public enum Month { 10 | January(1,"一月"), 11 | February(2,"二月"), 12 | March(3,"三月"), 13 | April(4,"四月"), 14 | May(5,"五月"), 15 | June(6,"六月"), 16 | July(7,"七月"), 17 | August(8,"八月"), 18 | September(9,"九月"), 19 | October(10,"十月"), 20 | November(11, "十一月"), 21 | December(12,"十二月") 22 | ; 23 | @EnumValue 24 | private int month; 25 | private String mes; 26 | 27 | Month(int month, String mes){ 28 | this.month = month; 29 | this.mes = mes; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/constant/Sex.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.constant; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public enum Sex { 7 | Girl, 8 | Boy 9 | } 10 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/constant/Work.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.constant; 2 | 3 | import com.javaoffers.brief.modelhelper.anno.EnumValue; 4 | 5 | /** 6 | * @description: 7 | * @author: create by cmj on 2023/1/2 16:10 8 | */ 9 | public enum Work { 10 | 11 | JAVA(1,"JAVA"), 12 | PYTHON(2,"PYTHON") 13 | ; 14 | private int code; 15 | @EnumValue 16 | private String workName; 17 | 18 | Work(int code, String workName){ 19 | this.code = code; 20 | this.workName = workName; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/mapper/BriefEncryptDataMapper.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.mapper; 2 | 3 | import com.javaoffers.base.modelhelper.sample.model.EncryptData; 4 | import com.javaoffers.brief.modelhelper.mapper.BriefMapper; 5 | 6 | /** 7 | * @description: 8 | * CREATE TABLE `encrypt_data` ( 9 | * `id` int(11) NOT NULL AUTO_INCREMENT, 10 | * `encrypt_num` varchar(512) COLLATE utf8_bin DEFAULT NULL, 11 | * PRIMARY KEY (`id`) 12 | * ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; 13 | * @author: create by cmj on 2022/10/15 00:55 14 | */ 15 | public interface BriefEncryptDataMapper extends BriefMapper { 16 | } 17 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/mapper/BriefTeacherMapper.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.mapper; 2 | 3 | import com.javaoffers.base.modelhelper.sample.model.Teacher; 4 | import com.javaoffers.brief.modelhelper.mapper.BriefMapper; 5 | 6 | /** 7 | * @author mingJie 8 | */ 9 | public interface BriefTeacherMapper extends BriefMapper { 10 | } 11 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/mapper/BriefUserOrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.mapper; 2 | 3 | import com.javaoffers.base.modelhelper.sample.model.UserOrder; 4 | import com.javaoffers.brief.modelhelper.mapper.BriefMapper; 5 | 6 | /** 7 | * @description: 8 | * @author: create by cmj on 2022/10/15 00:55 9 | */ 10 | public interface BriefUserOrderMapper extends BriefMapper { 11 | } 12 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/mapper/EncryptDataAuMapper.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.mapper; 2 | 3 | import com.javaoffers.base.modelhelper.sample.model.EncryptDataAutoUpdate; 4 | import com.javaoffers.brief.modelhelper.mapper.BriefMapper; 5 | 6 | public interface EncryptDataAuMapper extends BriefMapper { 7 | } 8 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/mapper/ShardingUserMapper.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.mapper; 2 | 3 | import com.javaoffers.base.modelhelper.sample.model.ShardingUser; 4 | import com.javaoffers.brief.modelhelper.mapper.BriefMapper; 5 | 6 | /** 7 | * desc. 8 | * 9 | * @author cao ming jie create by 2025/10/6 10 | */ 11 | public interface ShardingUserMapper extends BriefMapper { 12 | } 13 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | //package com.javaoffers.base.modelhelper.sample.mapper; 2 | // 3 | //import com.javaoffers.base.modelhelper.sample.model.User; 4 | //import org.apache.ibatis.annotations.Select; 5 | // 6 | //import java.util.List; 7 | //import java.util.Map; 8 | // 9 | //public interface UserMapper { 10 | // 11 | // User queryUserDataLimitOne(); 12 | // 13 | // List queryUserData(); 14 | // 15 | // List queryUserAndOrder(); 16 | // 17 | // User queryUserAndOrderOne(); 18 | // 19 | // @Select("select * from user limit 1") 20 | // User queryUserLimitOne(); 21 | // 22 | // @Select("select a.* , b.id as orderId, b.* from user a left join user_order b on a.id = b.user_id") 23 | // List queryUserLimitOneAndOrder(); 24 | //} 25 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/model/EncryptData.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.model; 2 | 3 | import com.javaoffers.brief.modelhelper.anno.BaseModel; 4 | import com.javaoffers.brief.modelhelper.anno.BaseUnique; 5 | import lombok.Data; 6 | 7 | @Data 8 | @BaseModel 9 | public class EncryptData { 10 | 11 | @BaseUnique 12 | private Integer id; 13 | 14 | private String encryptNum; 15 | } 16 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/model/EncryptDataAutoUpdate.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.model; 2 | 3 | import com.javaoffers.brief.modelhelper.anno.BaseModel; 4 | import com.javaoffers.brief.modelhelper.anno.BaseUnique; 5 | import lombok.Data; 6 | 7 | /** 8 | * Used for testing automatic updates 9 | */ 10 | @Data 11 | @BaseModel(value = "encrypt_data") 12 | public class EncryptDataAutoUpdate { 13 | 14 | @BaseUnique 15 | private Integer id; 16 | 17 | private String encryptNum; 18 | } 19 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/model/UserTeacher.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.model; 2 | 3 | import com.javaoffers.brief.modelhelper.anno.BaseModel; 4 | import com.javaoffers.brief.modelhelper.anno.BaseUnique; 5 | import lombok.Data; 6 | 7 | /** 8 | * CREATE TABLE `user_teacher` ( 9 | * `id` int(11) NOT NULL AUTO_INCREMENT, 10 | * `user_id` int(255) DEFAULT NULL, 11 | * `teacher_id` int(255) DEFAULT NULL, 12 | * PRIMARY KEY (`id`) 13 | * ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; 14 | * @author mingJie 15 | */ 16 | @BaseModel 17 | @Data 18 | public class UserTeacher { 19 | @BaseUnique 20 | private Integer id; 21 | private Integer userId; 22 | private Integer teacherId; 23 | } 24 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/model/ViewModel.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.model; 2 | 3 | import com.javaoffers.brief.modelhelper.anno.BaseModel; 4 | import com.javaoffers.brief.modelhelper.anno.BaseUnique; 5 | import lombok.Data; 6 | 7 | /** 8 | *SQL: 9 | * select table_x.id as table_x__id, table_x.age as table_x__age, table_x.name as table_x__name 10 | * from (select id, age, name from user) table_x where 1=1 11 | */ 12 | @BaseModel(value = "table_x", fromView = "(select id, age, name from user)") 13 | @Data 14 | public class ViewModel { 15 | 16 | @BaseUnique 17 | private Integer id; 18 | private Integer age; 19 | private String name; 20 | } 21 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/model/WithAsModel.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.model; 2 | 3 | import com.javaoffers.brief.modelhelper.anno.BaseModel; 4 | import com.javaoffers.brief.modelhelper.anno.BaseUnique; 5 | import lombok.Data; 6 | 7 | /** 8 | * SQL: 9 | * with table_x as (select id, age, name from user) 10 | * select table_x.id as table_x__id, table_x.age as table_x__age, table_x.name as table_x__name 11 | * from table_x where 1=1 12 | */ 13 | @BaseModel(value = "table_x", frontView = "with table_x as (select id, age, name from user)") 14 | @Data 15 | public class WithAsModel { 16 | 17 | @BaseUnique 18 | private Integer id; 19 | private Integer age; 20 | private String name; 21 | } 22 | -------------------------------------------------------------------------------- /brief-samples/brief-commom-sample/src/main/java/com/javaoffers/base/modelhelper/sample/utils/LOGUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright © 2019 mh615 Info. All rights reserved. 3 | * 4 | * 功能描述: 5 | * @Package: com.mh.others.utils.log 6 | * @author: cmj 7 | * @date: 2019-1-18 上午10:27:07 8 | */ 9 | package com.javaoffers.base.modelhelper.sample.utils; 10 | 11 | /** 12 | * @author mingJie 13 | */ 14 | public class LOGUtils { 15 | 16 | 17 | 18 | public static void printLog(Object log){ 19 | System.out.println(log.toString()); 20 | } 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /brief-samples/brief-mybatis-sample/src/main/java/com/javaoffers/base/modelhelper/sample/spring/config/encrypt/anno/EncryptTableColumns.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.spring.config.encrypt.anno; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * @author mingJie 7 | */ 8 | @Documented 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.TYPE) 11 | public @interface EncryptTableColumns { 12 | 13 | /** 14 | * 表名称 15 | * @return 16 | */ 17 | String tableName(); 18 | 19 | /** 20 | * 表字段名称 21 | * @return 22 | */ 23 | String[] columns(); 24 | } 25 | -------------------------------------------------------------------------------- /brief-samples/brief-mybatis-sample/src/main/java/com/javaoffers/base/modelhelper/sample/spring/filter/JqlSampleFilter.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.spring.filter; 2 | 3 | import com.javaoffers.brief.modelhelper.filter.JqlExecutorChain; 4 | import com.javaoffers.brief.modelhelper.filter.JqlExecutorFilter; 5 | 6 | /** 7 | * @description: 测试filter 8 | * @author: create by cmj on 2023/6/1 21:01 9 | */ 10 | public class JqlSampleFilter implements JqlExecutorFilter { 11 | @Override 12 | public Object filter(JqlExecutorChain chain) { 13 | System.out.println("-------------------------- 0 0 ---------------------- "); 14 | return chain.doChain(); 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /brief-samples/brief-mybatis-sample/src/main/java/com/javaoffers/base/modelhelper/sample/spring/interceptor/LogInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.spring.interceptor; 2 | 3 | import com.javaoffers.brief.modelhelper.core.BaseSQLInfo; 4 | import com.javaoffers.brief.modelhelper.context.JqlInterceptor; 5 | 6 | /** 7 | * 支持spring环境. 8 | * @description: print sql 9 | * @author: create by cmj on 2023/5/27 19:00 10 | */ 11 | //@Component 12 | public class LogInterceptor implements JqlInterceptor { 13 | @Override 14 | public void handler(BaseSQLInfo baseSQLInfo) { 15 | System.out.println("LogInterceptor: SQL : "+ baseSQLInfo.getSql()); 16 | System.out.println("LogInterceptor: Param: " +baseSQLInfo.getParams()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /brief-samples/brief-orms-sample/src/main/java/BriefSample.java: -------------------------------------------------------------------------------- 1 | import brief.BriefInitializer; 2 | 3 | public class BriefSample { 4 | 5 | public static void main(String[] args) { 6 | BriefInitializer.init(); 7 | BriefInitializer.selectOne(); 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /brief-samples/brief-orms-sample/src/main/java/flex/mapper/FlexAccountMapper.java: -------------------------------------------------------------------------------- 1 | package flex.mapper; 2 | 3 | import com.mybatisflex.core.BaseMapper; 4 | import flex.entity.FlexAccount; 5 | 6 | public interface FlexAccountMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /brief-samples/brief-orms-sample/src/main/java/plus/mapper/PlusAccountMapper.java: -------------------------------------------------------------------------------- 1 | package plus.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import org.apache.ibatis.annotations.Param; 5 | import org.apache.ibatis.annotations.Select; 6 | import plus.entity.PlusAccount; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | public interface PlusAccountMapper extends BaseMapper { 12 | 13 | @Select("SELECT * FROM tb_account WHERE id > 100 and user_name = #{admin} limit 10000") 14 | public List> queryTop10000(@Param("admin") String admin); 15 | } 16 | -------------------------------------------------------------------------------- /brief-samples/brief-orms-sample/src/main/resources/mybatis-flex.properties: -------------------------------------------------------------------------------- 1 | # close mapper generate 2 | processor.mappersGenerateEnable = false -------------------------------------------------------------------------------- /brief-samples/brief-orms-sample/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `tb_account` 2 | ( 3 | `id` INTEGER PRIMARY KEY auto_increment, 4 | `user_name` VARCHAR(100), 5 | `password` VARCHAR(128), 6 | `salt` VARCHAR(32), 7 | `nickname` VARCHAR(128), 8 | `email` VARCHAR(64), 9 | `mobile` VARCHAR(32), 10 | `avatar` VARCHAR(256), 11 | `type` Integer, 12 | `status` Integer, 13 | `created` DATETIME, 14 | `options` VARCHAR(2048) 15 | ); -------------------------------------------------------------------------------- /brief-samples/brief-speedier-sample/src/main/java/com/javaoffers/base/modelhelper/sample/MockBriefJdbcExecutorFactory.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample; 2 | 3 | import com.javaoffers.brief.modelhelper.jdbc.BriefJdbcExecutor; 4 | import com.javaoffers.brief.modelhelper.jdbc.BriefJdbcExecutorFactory; 5 | import com.javaoffers.brief.modelhelper.jdbc.JdbcExecutor; 6 | 7 | import javax.sql.DataSource; 8 | 9 | public class MockBriefJdbcExecutorFactory extends BriefJdbcExecutorFactory { 10 | 11 | @Override 12 | public JdbcExecutor createJdbcExecutor(DataSource dataSource, Class modelClass) { 13 | return new MockBriefJdbcExecutor(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /brief-samples/brief-speedier-sample/src/main/java/com/javaoffers/base/modelhelper/sample/sqlite/SqliteSample.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.base.modelhelper.sample.sqlite; 2 | 3 | public class SqliteSample { 4 | } 5 | -------------------------------------------------------------------------------- /brief-samples/brief-speedier-sample/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{yyyy-MM-dd HH:mm:ss} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /brief-sharding/src/main/java/com/javaoffers/brief/modelhelper/sharding/derive/ShardingStrategy.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.sharding.derive; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * desc. 11 | * 12 | * @author cao ming jie create by 2025/5/2 13 | */ 14 | @Target({ElementType.FIELD}) 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Inherited 17 | public @interface ShardingStrategy { 18 | /** 19 | * 指定sharding strategic 20 | * @return 21 | */ 22 | Class value() default ShardingTableStrategy.class; 23 | } 24 | -------------------------------------------------------------------------------- /brief-sharding/src/main/java/com/javaoffers/brief/modelhelper/sharding/exception/ShardingConfigException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.sharding.exception; 2 | 3 | /** 4 | * desc. 5 | * 6 | * @author cao ming jie create by 2025/10/8 7 | */ 8 | public class ShardingConfigException extends RuntimeException { 9 | public ShardingConfigException(String message) { 10 | super(message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /brief-speedier/src/main/java/com/javaoffers/brief/modelhelper/speedier/transaction/BriefTransaction.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.speedier.transaction; 2 | 3 | /** 4 | * @author mingJie 5 | */ 6 | public interface BriefTransaction { 7 | /** 8 | * 打开事务. 9 | */ 10 | public void openTransaction(); 11 | 12 | /** 13 | * 提交事务. 14 | */ 15 | public void commitTransaction(); 16 | 17 | /** 18 | * 回滚事务. 19 | */ 20 | public void rollbackTransaction(); 21 | } 22 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/brief/modelhelper/parser/ConditionName.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.parser; 2 | 3 | /** 4 | * @author cmj 5 | * @createTime 2023年03月04日 14:22:00 6 | */ 7 | public enum ConditionName { 8 | 9 | SELECT_COL_NAME("select_col_name",1), 10 | WHERE("where",2), 11 | ON("on", 3), 12 | VALUES("values", 4), 13 | UPDATE_SET("update_set", 5), 14 | ; 15 | private String name; 16 | private int code; 17 | 18 | ConditionName(String name, int code){ 19 | this.name = name; 20 | this.code = code; 21 | } 22 | 23 | public static boolean isWhereOnName(ConditionName conditionName){ 24 | return conditionName == WHERE || conditionName == ON; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/brief/modelhelper/parser/TableColumns.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.parser; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | /** 7 | * create by cmj 8 | */ 9 | public class TableColumns { 10 | private String tableName; 11 | private Set columns = new HashSet<>(); 12 | 13 | public String getTableName() { 14 | return tableName; 15 | } 16 | 17 | public void setTableName(String tableName) { 18 | this.tableName = tableName; 19 | } 20 | 21 | public Set getColumns() { 22 | return columns; 23 | } 24 | 25 | public void setColumns(Set columns) { 26 | this.columns = columns; 27 | } 28 | } -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/Model.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.thrid.jsqlparser;/*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2020 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | 11 | /** 12 | *

A marker interface for com.javaoffers.thrid.jsqlparser-model-classes.

13 | *

The datastructure where the sql syntax is represented by a tree consists of {@link Model}'s

14 | */ 15 | public interface Model { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/expression/AllValue.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.expression; 11 | 12 | import com.javaoffers.thrid.jsqlparser.parser.ASTNodeAccessImpl; 13 | 14 | public class AllValue extends ASTNodeAccessImpl implements Expression { 15 | 16 | @Override 17 | public void accept(ExpressionVisitor expressionVisitor) { 18 | expressionVisitor.visit(this); 19 | } 20 | 21 | @Override 22 | public String toString() { 23 | return "ALL"; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/expression/AnalyticType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.expression; 11 | 12 | public enum AnalyticType { 13 | OVER, 14 | WITHIN_GROUP, 15 | FILTER_ONLY 16 | } 17 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/expression/AnyType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.expression; 11 | 12 | public enum AnyType { 13 | 14 | ANY, 15 | SOME, 16 | ALL 17 | } 18 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/expression/Expression.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.expression; 11 | 12 | import com.javaoffers.thrid.jsqlparser.Model; 13 | import com.javaoffers.thrid.jsqlparser.parser.ASTNodeAccess; 14 | 15 | public interface Expression extends ASTNodeAccess, Model { 16 | 17 | void accept(ExpressionVisitor expressionVisitor); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/expression/JsonFunctionType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2021 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | 11 | package com.javaoffers.thrid.jsqlparser.expression; 12 | 13 | /** 14 | * 15 | * @author
Andreas Reichel 16 | */ 17 | public enum JsonFunctionType { 18 | OBJECT 19 | , ARRAY 20 | , POSTGRES_OBJECT 21 | , MYSQL_OBJECT 22 | } 23 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/expression/NullValue.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.expression; 11 | 12 | import com.javaoffers.thrid.jsqlparser.parser.ASTNodeAccessImpl; 13 | 14 | public class NullValue extends ASTNodeAccessImpl implements Expression { 15 | 16 | @Override 17 | public void accept(ExpressionVisitor expressionVisitor) { 18 | expressionVisitor.visit(this); 19 | } 20 | 21 | @Override 22 | public String toString() { 23 | return "NULL"; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/expression/operators/relational/GeometryDistance.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2022 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.expression.operators.relational; 11 | 12 | import com.javaoffers.thrid.jsqlparser.expression.ExpressionVisitor; 13 | 14 | public class GeometryDistance extends ComparisonOperator { 15 | 16 | public GeometryDistance() { 17 | super("<->"); 18 | } 19 | 20 | public GeometryDistance(String operator) { 21 | super(operator); 22 | } 23 | 24 | @Override 25 | public void accept(ExpressionVisitor expressionVisitor) { 26 | expressionVisitor.visit(this); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/expression/operators/relational/ItemsList.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.expression.operators.relational; 11 | 12 | /** 13 | * Values of an "INSERT" com.javaoffers.thrid.sqlparse.statement (for example a SELECT or a list of expressions) 14 | */ 15 | public interface ItemsList { 16 | 17 | void accept(ItemsListVisitor itemsListVisitor); 18 | } 19 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/expression/operators/relational/ItemsListVisitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.expression.operators.relational; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.select.SubSelect; 13 | 14 | public interface ItemsListVisitor { 15 | 16 | void visit(SubSelect subSelect); 17 | 18 | void visit(ExpressionList expressionList); 19 | 20 | void visit(NamedExpressionList namedExpressionList); 21 | 22 | void visit(MultiExpressionList multiExprList); 23 | } 24 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/expression/operators/relational/RegExpMatchOperatorType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.expression.operators.relational; 11 | 12 | /** 13 | * PostgresSQL match operators. 14 | */ 15 | public enum RegExpMatchOperatorType { 16 | MATCH_CASESENSITIVE, 17 | MATCH_CASEINSENSITIVE, 18 | NOT_MATCH_CASESENSITIVE, 19 | NOT_MATCH_CASEINSENSITIVE 20 | } 21 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/parser/ASTNodeAccess.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.parser; 11 | 12 | public interface ASTNodeAccess { 13 | 14 | SimpleNode getASTNode(); 15 | 16 | void setASTNode(SimpleNode node); 17 | } 18 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/parser/ASTNodeAccessImpl.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.parser; 11 | 12 | public class ASTNodeAccessImpl implements ASTNodeAccess { 13 | 14 | private SimpleNode node; 15 | 16 | @Override 17 | public SimpleNode getASTNode() { 18 | return node; 19 | } 20 | 21 | @Override 22 | public void setASTNode(SimpleNode node) { 23 | this.node = node; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/parser/BaseToken.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.parser; 11 | 12 | public class BaseToken { 13 | 14 | public int absoluteBegin = 0; 15 | public int absoluteEnd = 0; 16 | } 17 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/parser/CCJSqlParserDefaultVisitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2022 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | /* Generated By:JavaCC: Do not edit this line. CCJSqlParserDefaultVisitor.java Version 7.0.10 */ 11 | package com.javaoffers.thrid.jsqlparser.parser; 12 | 13 | public class CCJSqlParserDefaultVisitor implements CCJSqlParserVisitor{ 14 | public Object defaultVisit(SimpleNode node, Object data){ 15 | node.childrenAccept(this, data); 16 | return data; 17 | } 18 | public Object visit(SimpleNode node, Object data){ 19 | return defaultVisit(node, data); 20 | } 21 | } 22 | /* JavaCC - OriginalChecksum=eb2cf5c6c0fab8f83fd100e2a6faab45 (do not edit this line) */ 23 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/parser/CCJSqlParserVisitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2022 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | /* Generated By:JavaCC: Do not edit this line. CCJSqlParserVisitor.java Version 7.0.10 */ 11 | package com.javaoffers.thrid.jsqlparser.parser; 12 | 13 | public interface CCJSqlParserVisitor 14 | { 15 | public Object visit(SimpleNode node, Object data); 16 | } 17 | /* JavaCC - OriginalChecksum=2f58de7c587dc1563a175df7a43380fb (do not edit this line) */ 18 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/parser/JSqlParser.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.parser; 11 | 12 | import com.javaoffers.thrid.jsqlparser.JSQLParserException; 13 | import com.javaoffers.thrid.jsqlparser.statement.Statement; 14 | 15 | import java.io.Reader; 16 | 17 | public interface JSqlParser { 18 | 19 | Statement parse(Reader statementReader) throws JSQLParserException; 20 | } 21 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/parser/StatementListener.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.parser; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.Statement; 13 | 14 | /** 15 | * 16 | * @author Tobias Warneke (t.warneke@gmx.net) 17 | */ 18 | public interface StatementListener { 19 | 20 | void accept(Statement statement); 21 | } 22 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/schema/MultiPartName.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.schema; 11 | 12 | public interface MultiPartName { 13 | 14 | String getFullyQualifiedName(); 15 | } 16 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/Commit.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement; 11 | 12 | public class Commit implements Statement { 13 | @Override 14 | public void accept(StatementVisitor statementVisitor) { 15 | statementVisitor.visit(this); 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | return "COMMIT"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/DeclareType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement; 11 | 12 | /** 13 | * 14 | * @author tobens 15 | */ 16 | public enum DeclareType { 17 | TABLE, AS, TYPE 18 | } 19 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/PurgeObjectType.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2021 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement; 11 | 12 | /** 13 | * 14 | * @author Andreas Reichel 15 | */ 16 | public enum PurgeObjectType { 17 | TABLE, INDEX, RECYCLEBIN, DBA_RECYCLEBIN, TABLESPACE; 18 | } 19 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/Statement.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement; 11 | 12 | import com.javaoffers.thrid.jsqlparser.*; 13 | 14 | public interface Statement extends Model { 15 | void accept(StatementVisitor statementVisitor); 16 | } 17 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/alter/AlterOperation.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.alter; 11 | 12 | public enum AlterOperation { 13 | ADD, ALTER, DROP, DROP_PRIMARY_KEY, DROP_UNIQUE, DROP_FOREIGN_KEY, MODIFY, CHANGE, ALGORITHM, RENAME, RENAME_TABLE, COMMENT, UNSPECIFIC; 14 | } 15 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/alter/ConstraintState.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.alter; 11 | 12 | public interface ConstraintState { 13 | } 14 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/create/table/RowMovementMode.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2020 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.create.table; 11 | 12 | public enum RowMovementMode { 13 | ENABLE, DISABLE; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/create/view/ForceOption.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.create.view; 11 | 12 | public enum ForceOption { 13 | NONE, 14 | 15 | FORCE, 16 | 17 | NO_FORCE 18 | } 19 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/create/view/TemporaryOption.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.create.view; 11 | 12 | public enum TemporaryOption { 13 | NONE, 14 | 15 | TEMP, 16 | 17 | TEMPORARY 18 | } 19 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/delete/DeleteModifierPriority.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.delete; 11 | 12 | public enum DeleteModifierPriority { 13 | LOW_PRIORITY 14 | } 15 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/insert/InsertModifierPriority.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.insert; 11 | 12 | public enum InsertModifierPriority { 13 | LOW_PRIORITY, DELAYED, HIGH_PRIORITY, IGNORE 14 | } 15 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/ExceptOp.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.select.SetOperationList.SetOperationType; 13 | 14 | public class ExceptOp extends SetOperation { 15 | 16 | public ExceptOp() { 17 | super(SetOperationType.EXCEPT); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/FromItemVisitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | import com.javaoffers.thrid.jsqlparser.schema.Table; 13 | 14 | public interface FromItemVisitor { 15 | 16 | void visit(Table tableName); 17 | 18 | void visit(SubSelect subSelect); 19 | 20 | void visit(SubJoin subjoin); 21 | 22 | void visit(LateralSubSelect lateralSubSelect); 23 | 24 | void visit(ValuesList valuesList); 25 | 26 | void visit(TableFunction tableFunction); 27 | 28 | void visit(ParenthesisFromItem aThis); 29 | } 30 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/GroupByVisitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | public interface GroupByVisitor { 13 | 14 | void visit(GroupByElement groupBy); 15 | } 16 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/IntersectOp.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.select.SetOperationList.SetOperationType; 13 | 14 | public class IntersectOp extends SetOperation { 15 | 16 | public IntersectOp() { 17 | super(SetOperationType.INTERSECT); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/IntoTableVisitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | import com.javaoffers.thrid.jsqlparser.schema.Table; 13 | 14 | public interface IntoTableVisitor { 15 | 16 | void visit(Table tableName); 17 | } 18 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/IntoTableVisitorAdapter.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | import com.javaoffers.thrid.jsqlparser.schema.Table; 13 | 14 | @SuppressWarnings({"PMD.UncommentedEmptyMethodBody"}) 15 | public class IntoTableVisitorAdapter implements IntoTableVisitor { 16 | 17 | @Override 18 | public void visit(Table tableName) { 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/MinusOp.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.select.SetOperationList.SetOperationType; 13 | 14 | public class MinusOp extends SetOperation { 15 | 16 | public MinusOp() { 17 | super(SetOperationType.MINUS); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/MySqlSqlCacheFlags.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2022 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | /** 13 | * 14 | * @author tw 15 | */ 16 | public enum MySqlSqlCacheFlags { 17 | SQL_CACHE, SQL_NO_CACHE 18 | } 19 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/OrderByVisitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | public interface OrderByVisitor { 13 | 14 | void visit(OrderByElement orderBy); 15 | } 16 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/OrderByVisitorAdapter.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | @SuppressWarnings({"PMD.UncommentedEmptyMethodBody"}) 13 | public class OrderByVisitorAdapter implements OrderByVisitor { 14 | 15 | @Override 16 | public void visit(OrderByElement orderBy) { 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/PivotVisitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | public interface PivotVisitor { 13 | 14 | void visit(Pivot pivot); 15 | 16 | void visit(PivotXml pivot); 17 | 18 | void visit(UnPivot unpivot); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/PivotVisitorAdapter.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | @SuppressWarnings({"PMD.UncommentedEmptyMethodBody"}) 13 | public class PivotVisitorAdapter implements PivotVisitor { 14 | 15 | @Override 16 | public void visit(Pivot pivot) { 17 | 18 | } 19 | 20 | @Override 21 | public void visit(PivotXml pivot) { 22 | 23 | } 24 | 25 | @Override 26 | public void visit(UnPivot unpivot) { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/SelectBody.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | import com.javaoffers.thrid.jsqlparser.Model; 13 | 14 | public interface SelectBody extends Model { 15 | 16 | void accept(SelectVisitor selectVisitor); 17 | } 18 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/SelectItem.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | import com.javaoffers.thrid.jsqlparser.parser.ASTNodeAccess; 13 | 14 | public interface SelectItem extends ASTNodeAccess { 15 | 16 | void accept(SelectItemVisitor selectItemVisitor); 17 | } 18 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/SelectItemVisitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | public interface SelectItemVisitor { 13 | 14 | void visit(AllColumns allColumns); 15 | 16 | void visit(AllTableColumns allTableColumns); 17 | 18 | void visit(SelectExpressionItem selectExpressionItem); 19 | } 20 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/SelectItemVisitorAdapter.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | @SuppressWarnings({"PMD.UncommentedEmptyMethodBody"}) 13 | public class SelectItemVisitorAdapter implements SelectItemVisitor { 14 | 15 | @Override 16 | public void visit(AllColumns columns) { 17 | 18 | } 19 | 20 | @Override 21 | public void visit(AllTableColumns columns) { 22 | 23 | } 24 | 25 | @Override 26 | public void visit(SelectExpressionItem item) { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/SelectVisitor.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.values.ValuesStatement; 13 | 14 | public interface SelectVisitor { 15 | 16 | void visit(PlainSelect plainSelect); 17 | 18 | void visit(SetOperationList setOpList); 19 | 20 | void visit(WithItem withItem); 21 | 22 | void visit(ValuesStatement aThis); 23 | } 24 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/SetOperation.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | import com.javaoffers.thrid.jsqlparser.parser.ASTNodeAccessImpl; 13 | import com.javaoffers.thrid.jsqlparser.statement.select.SetOperationList.SetOperationType; 14 | 15 | public abstract class SetOperation extends ASTNodeAccessImpl { 16 | 17 | private SetOperationType type; 18 | 19 | public SetOperation(SetOperationType type) { 20 | this.type = type; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return type.name(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/select/WithIsolation.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.select; 11 | 12 | 13 | public class WithIsolation { 14 | 15 | private String isolation = "UR"; 16 | 17 | public String getIsolation() { 18 | return this.isolation; 19 | } 20 | public void setIsolation(String s) { 21 | this.isolation = s; 22 | } 23 | 24 | @Override 25 | public String toString() { 26 | return " WITH " + this.isolation; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/statement/update/UpdateModifierPriority.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.statement.update; 11 | 12 | public enum UpdateModifierPriority { 13 | LOW_PRIORITY 14 | } 15 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/cnfexpression/MultiOrExpression.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.cnfexpression; 11 | 12 | import com.javaoffers.thrid.jsqlparser.expression.Expression; 13 | 14 | import java.util.List; 15 | 16 | public final class MultiOrExpression extends MultipleExpression { 17 | 18 | public MultiOrExpression(List childlist) { 19 | super(childlist); 20 | } 21 | 22 | @Override 23 | public String getStringExpression() { 24 | return "OR"; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/deparser/AlterDeParser.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.deparser; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.alter.Alter; 13 | 14 | public class AlterDeParser extends AbstractDeParser { 15 | 16 | public AlterDeParser(StringBuilder buffer) { 17 | super(buffer); 18 | } 19 | 20 | @Override 21 | public void deParse(Alter alter) { 22 | buffer.append(alter.toString()); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/deparser/AlterSessionDeParser.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.deparser; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.alter.AlterSession; 13 | 14 | public class AlterSessionDeParser extends AbstractDeParser { 15 | 16 | public AlterSessionDeParser(StringBuilder buffer) { 17 | super(buffer); 18 | } 19 | 20 | @Override 21 | public void deParse(AlterSession alterSession) { 22 | buffer.append(alterSession.toString()); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/deparser/ShowColumnsStatementDeParser.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.deparser; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.ShowColumnsStatement; 13 | 14 | public class ShowColumnsStatementDeParser extends AbstractDeParser { 15 | 16 | public ShowColumnsStatementDeParser(StringBuilder buffer) { 17 | super(buffer); 18 | } 19 | 20 | @Override 21 | public void deParse(ShowColumnsStatement show) { 22 | buffer.append("SHOW COLUMNS FROM ").append(show.getTableName()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/deparser/ShowStatementDeParser.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.deparser; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.ShowStatement; 13 | 14 | public class ShowStatementDeParser extends AbstractDeParser { 15 | 16 | public ShowStatementDeParser(StringBuilder buffer) { 17 | super(buffer); 18 | } 19 | 20 | @Override 21 | public void deParse(ShowStatement show) { 22 | buffer.append("SHOW ").append(show.getName()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/deparser/ShowTablesStatementDeparser.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2020 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.deparser; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.show.ShowTablesStatement; 13 | 14 | public class ShowTablesStatementDeparser extends AbstractDeParser { 15 | 16 | public ShowTablesStatementDeparser(StringBuilder buffer) { 17 | super(buffer); 18 | } 19 | 20 | @Override 21 | void deParse(ShowTablesStatement statement) { 22 | buffer.append(statement); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/deparser/UseStatementDeParser.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.deparser; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.UseStatement; 13 | 14 | public class UseStatementDeParser extends AbstractDeParser { 15 | 16 | public UseStatementDeParser(StringBuilder buffer) { 17 | super(buffer); 18 | } 19 | 20 | @Override 21 | public void deParse(UseStatement set) { 22 | buffer.append("USE "); 23 | if (set.hasSchemaKeyword()) { 24 | buffer.append("SCHEMA "); 25 | } 26 | buffer.append(set.getName()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/validation/ContextKey.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2020 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.validation; 11 | 12 | /** 13 | * the context key - a ValidationCapability should define constants of expected 14 | * context - values needed for validation. 15 | */ 16 | public interface ContextKey { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/validation/ParseContext.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2020 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.validation; 11 | 12 | /** 13 | * @author gitmotte 14 | * @see ParseCapability 15 | */ 16 | enum ParseContext implements ContextKey { 17 | statement 18 | } 19 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/validation/allowedtypes/AllowedTypesContext.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2020 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.validation.allowedtypes; 11 | 12 | import com.javaoffers.thrid.jsqlparser.util.validation.ContextKey; 13 | 14 | public enum AllowedTypesContext implements ContextKey { 15 | /** 16 | * a collection of allowed {@link Class}es 17 | */ 18 | allowed_types, 19 | /** 20 | * the object given (may be null) 21 | */ 22 | argument, 23 | /** 24 | * a boolean, default = true 25 | */ 26 | allow_null 27 | } 28 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/validation/feature/FeatureContext.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2020 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.validation.feature; 11 | 12 | import com.javaoffers.thrid.jsqlparser.parser.feature.Feature; 13 | import com.javaoffers.thrid.jsqlparser.util.validation.ContextKey; 14 | 15 | public enum FeatureContext implements ContextKey { 16 | /** 17 | * @see Feature 18 | */ 19 | feature 20 | } 21 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/validation/metadata/MetadataContext.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2020 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.validation.metadata; 11 | 12 | import com.javaoffers.thrid.jsqlparser.util.validation.ContextKey; 13 | 14 | public enum MetadataContext implements ContextKey { 15 | /** 16 | * @see Named 17 | */ 18 | named, 19 | /** 20 | * true, check for existence, 21 | * false, check for non-existence 22 | */ 23 | exists 24 | } 25 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/validation/validator/AlterSessionValidator.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2020 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.validation.validator; 11 | 12 | import com.javaoffers.thrid.jsqlparser.statement.alter.AlterSession; 13 | 14 | /** 15 | * @author gitmotte 16 | */ 17 | public class AlterSessionValidator extends AbstractValidator { 18 | @Override 19 | public void validate(AlterSession statement) { 20 | //@todo: implement this method 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/validation/validator/ShowStatementValidator.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.validation.validator; 11 | 12 | import com.javaoffers.thrid.jsqlparser.parser.feature.Feature; 13 | import com.javaoffers.thrid.jsqlparser.statement.ShowStatement; 14 | 15 | /** 16 | * @author gitmotte 17 | */ 18 | public class ShowStatementValidator extends AbstractValidator { 19 | 20 | @Override 21 | public void validate(ShowStatement show) { 22 | validateFeature(Feature.show); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /brief-sqlstatement/src/main/java/com/javaoffers/thrid/jsqlparser/util/validation/validator/ValuesStatementValidator.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * #%L 3 | * JSQLParser library 4 | * %% 5 | * Copyright (C) 2004 - 2019 JSQLParser 6 | * %% 7 | * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 8 | * #L% 9 | */ 10 | package com.javaoffers.thrid.jsqlparser.util.validation.validator; 11 | 12 | import com.javaoffers.thrid.jsqlparser.parser.feature.Feature; 13 | import com.javaoffers.thrid.jsqlparser.statement.values.ValuesStatement; 14 | 15 | /** 16 | * @author gitmotte 17 | */ 18 | public class ValuesStatementValidator extends AbstractValidator { 19 | 20 | @Override 21 | public void validate(ValuesStatement values) { 22 | validateFeature(Feature.values); 23 | validateOptionalItemsList(values.getExpressions()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /brief-support/brief-clickhouse/src/main/java/com/javaoffers/brief/modelhelper/clickhouse/CHStatementParser.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.clickhouse; 2 | 3 | import com.javaoffers.brief.modelhelper.utils.DBType; 4 | 5 | public class CHStatementParser extends ClickHouseStatementParser { 6 | 7 | @Override 8 | public DBType getDBType() { 9 | return DBType.CLICK_HOUSE; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /brief-support/brief-clickhouse/src/main/java/com/javaoffers/brief/modelhelper/clickhouse/CHTableInfoParser.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.clickhouse; 2 | 3 | import com.javaoffers.brief.modelhelper.context.SmartTableInfoParser; 4 | import com.javaoffers.brief.modelhelper.utils.DBType; 5 | import com.javaoffers.brief.modelhelper.utils.TableInfo; 6 | 7 | import java.sql.Connection; 8 | 9 | public class CHTableInfoParser extends ClickHouseTableInfoParser { 10 | 11 | @Override 12 | public void parseTableInfo(Connection connection, TableInfo tableInfo) { 13 | super.parseTableInfo(tableInfo); 14 | } 15 | 16 | @Override 17 | public DBType getDBType() { 18 | return DBType.CLICK_HOUSE; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /brief-support/brief-clickhouse/src/main/java/com/javaoffers/brief/modelhelper/clickhouse/ClickHouseTableInfoParser.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.clickhouse; 2 | 3 | import com.javaoffers.brief.modelhelper.context.SmartTableInfoParser; 4 | import com.javaoffers.brief.modelhelper.utils.DBType; 5 | import com.javaoffers.brief.modelhelper.utils.TableInfo; 6 | 7 | import java.sql.Connection; 8 | 9 | public class ClickHouseTableInfoParser extends SmartTableInfoParser { 10 | 11 | @Override 12 | public void parseTableInfo(Connection connection, TableInfo tableInfo) { 13 | super.parseTableInfo(tableInfo); 14 | } 15 | 16 | @Override 17 | public DBType getDBType() { 18 | return DBType.CLICKHOUSE; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /brief-support/brief-mybatis/src/main/java/com/javaoffers/brief/modelhelper/exception/VersionException.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.exception; 2 | 3 | /** 4 | * Version compatibility exception. 5 | * create by cmj 6 | */ 7 | public class VersionException extends RuntimeException { 8 | public VersionException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brief-support/brief-mybatis/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # Auto Configure 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | com.javaoffers.brief.modelhelper.install.InstallAgent\ 4 | -------------------------------------------------------------------------------- /brief-support/brief-oracle/src/main/java/com/javaoffers/brief/modelhelper/oracle/OracleTableInfoParser.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.oracle; 2 | 3 | import com.javaoffers.brief.modelhelper.context.SmartTableInfoParser; 4 | import com.javaoffers.brief.modelhelper.utils.DBType; 5 | import com.javaoffers.brief.modelhelper.utils.TableInfo; 6 | 7 | import java.sql.Connection; 8 | 9 | public class OracleTableInfoParser extends SmartTableInfoParser { 10 | 11 | @Override 12 | public void parseTableInfo(Connection connection, TableInfo tableInfo) { 13 | super.parseTableInfo(tableInfo); 14 | } 15 | 16 | @Override 17 | public DBType getDBType() { 18 | return DBType.ORACLE; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /brief-support/brief-pgsql/src/main/java/com/javaoffers/brief/modelhelper/pgsql/PostgreSqlTableInfoParser.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.pgsql; 2 | 3 | import com.javaoffers.brief.modelhelper.context.SmartTableInfoParser; 4 | import com.javaoffers.brief.modelhelper.utils.DBType; 5 | import com.javaoffers.brief.modelhelper.utils.TableInfo; 6 | 7 | import java.sql.Connection; 8 | 9 | public class PostgreSqlTableInfoParser extends SmartTableInfoParser { 10 | 11 | @Override 12 | public void parseTableInfo(Connection connection, TableInfo tableInfo) { 13 | super.parseTableInfo(tableInfo); 14 | } 15 | 16 | @Override 17 | public DBType getDBType() { 18 | return DBType.POSTGRESQL; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /brief-support/brief-spring-jdbc/src/main/java/com/javaoffers/brief/modelhelper/jdbc/spring/SpringJdbcExecutorFactory.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.jdbc.spring; 2 | 3 | import com.javaoffers.brief.modelhelper.jdbc.JdbcExecutor; 4 | import com.javaoffers.brief.modelhelper.jdbc.JdbcExecutorFactory; 5 | 6 | import javax.sql.DataSource; 7 | 8 | /** 9 | * @author mingJie 10 | */ 11 | public class SpringJdbcExecutorFactory implements JdbcExecutorFactory { 12 | 13 | public static final SpringJdbcExecutorFactory instance = new SpringJdbcExecutorFactory(); 14 | 15 | @Override 16 | public JdbcExecutor createJdbcExecutor(DataSource dataSource, Class modelClass) { 17 | return new SpringJdbcExecutor(dataSource, modelClass); 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /brief-support/brief-sqlite/src/main/java/com/javaoffers/brief/modelhelper/sqlite/SqliteTableInfoParser.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.sqlite; 2 | 3 | import com.javaoffers.brief.modelhelper.context.SmartTableInfoParser; 4 | import com.javaoffers.brief.modelhelper.utils.DBType; 5 | import com.javaoffers.brief.modelhelper.utils.TableInfo; 6 | 7 | import java.sql.Connection; 8 | 9 | public class SqliteTableInfoParser extends SmartTableInfoParser { 10 | 11 | @Override 12 | public void parseTableInfo(Connection connection, TableInfo tableInfo) { 13 | super.parseTableInfo(tableInfo); 14 | } 15 | 16 | @Override 17 | public DBType getDBType() { 18 | return DBType.SQLITE; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /brief-support/brief-sqlserver/src/main/java/com/javaoffers/brief/modelhelper/sqlserver/SqlServerTableInfoParser.java: -------------------------------------------------------------------------------- 1 | package com.javaoffers.brief.modelhelper.sqlserver; 2 | 3 | import com.javaoffers.brief.modelhelper.context.SmartTableInfoParser; 4 | import com.javaoffers.brief.modelhelper.utils.DBType; 5 | import com.javaoffers.brief.modelhelper.utils.TableInfo; 6 | 7 | import java.sql.Connection; 8 | 9 | public class SqlServerTableInfoParser extends SmartTableInfoParser { 10 | 11 | @Override 12 | public void parseTableInfo(Connection connection, TableInfo tableInfo) { 13 | super.parseTableInfo(tableInfo); 14 | } 15 | 16 | @Override 17 | public DBType getDBType() { 18 | return DBType.SQL_SERVER; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /note-doc/img/2220967059897.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaoffers/briefest/962b0c3308f2792a81b409c9aa01846ab10d3ee4/note-doc/img/2220967059897.png -------------------------------------------------------------------------------- /note-doc/img/qq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaoffers/briefest/962b0c3308f2792a81b409c9aa01846ab10d3ee4/note-doc/img/qq.jpg -------------------------------------------------------------------------------- /version.md: -------------------------------------------------------------------------------- 1 | - 3.5.11.7 2 | - 底层优化,新增update字段校验.不允许更新空字段 3 | - sql自动识别优化批处理 4 | - 新增注解@GroupConcat 5 | - 修改通用api返回Id包装类型 6 | - @ColName新增excludeColAll属性 7 | 8 | - 3.5.11.8 9 | - 避免批处理事务自动提交 10 | - 优化函数解析 11 | --------------------------------------------------------------------------------