Skip to content

Commit 490605e

Browse files
committed
refactor and add starUML model at path model
1 parent 65ef8a8 commit 490605e

File tree

24 files changed

+22565
-317
lines changed

24 files changed

+22565
-317
lines changed

common/src/main/java/com/robin/core/fileaccess/writer/AbstractQueueWriter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ protected byte[] constructContent(Map<String, ?> map) throws IOException {
6969
}
7070
else if(ResourceConst.VALUE_TYPE.PROTOBUF.getValue().equalsIgnoreCase(valueType)){
7171

72+
}else if(ResourceConst.VALUE_TYPE.ORC.getValue().equalsIgnoreCase(valueType)){
73+
7274
}
7375
return output;
7476
}

common/src/main/java/com/robin/core/resaccess/CommResIteratorFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
@Slf4j
1111
public class CommResIteratorFactory {
12-
private static final String KAFKA_ITER_CLASS = "com.robin.comm.resaccess.writer.KafkaResourceWriter";
12+
private static final String KAFKA_ITER_CLASS = "com.robin.comm.resaccess.writer.KafkaResourceIterator";
1313
private static final String CASSANDRA_ITER_CLASS = "com.robin.comm.resaccess.writer.CassandraResourceWriter";
1414
private static final String MONGO_ITER_CLASS = "com.robin.comm.resaccess.writer.MongoResourceWriter";
1515
private static final String REDIS_ITER_CLASS = "com.robin.comm.resaccess.writer.RedisResourceWriter";

core/src/main/java/com/robin/core/base/dao/IjdbcDao.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.util.List;
2121
import java.util.Map;
2222

23-
import com.robin.core.base.dao.util.AnnotationRetrevior;
2423
import com.robin.core.fileaccess.meta.DataCollectionMeta;
2524
import com.robin.core.query.extractor.ResultSetOperationExtractor;
2625
import org.springframework.jdbc.core.SqlParameter;
@@ -53,7 +52,7 @@ public interface IjdbcDao {
5352
* @return
5453
* @throws DAOException
5554
*/
56-
List<Map<String,Object>> queryBySql(String sqlstr) throws DAOException;
55+
//List<Map<String,Object>> queryBySql(String sqlstr) throws DAOException;
5756
/**
5857
* Batch update Records
5958
* @param sql
@@ -75,13 +74,13 @@ public interface IjdbcDao {
7574
void batchUpdateWithRowIterator(String sql, Iterator<Map<String,String>> rowIterator, DataCollectionMeta collectionMeta, int batchsize) throws DAOException;
7675
/**
7776
* Call Procedure
78-
* @param procedurename
77+
* @param procedureName
7978
* @param declaredParameters
80-
* @param inPara
79+
* @param inParam
8180
* @return
8281
* @throws DAOException
8382
*/
84-
Map<String,Object> executeCall(String procedurename, List<SqlParameter> declaredParameters, Map<String,Object> inPara) throws DAOException;
83+
Map<String,Object> executeCall(String procedureName, List<SqlParameter> declaredParameters, Map<String,Object> inParam) throws DAOException;
8584
/**
8685
* Call function
8786
* @param procedurename

core/src/main/java/com/robin/core/base/dao/JdbcDao.java

Lines changed: 42 additions & 55 deletions
Large diffs are not rendered by default.

core/src/main/java/com/robin/core/base/dao/LobCreatingPreparedStatementCallBack.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
import java.text.SimpleDateFormat;
2323
import java.util.Date;
2424
import java.util.List;
25-
import java.util.Map;
2625

27-
import com.robin.core.base.dao.util.AnnotationRetrevior;
26+
import com.robin.core.base.dao.util.AnnotationRetriver;
2827
import org.slf4j.Logger;
2928
import org.slf4j.LoggerFactory;
3029
import org.springframework.dao.DataAccessException;
@@ -37,15 +36,15 @@
3736
public class LobCreatingPreparedStatementCallBack extends
3837
AbstractLobCreatingPreparedStatementCallback {
3938
private BaseObject obj;
40-
private List<AnnotationRetrevior.FieldContent> fields;
39+
private List<AnnotationRetriver.FieldContent> fields;
4140
private Logger logger= LoggerFactory.getLogger(getClass());
4241

4342
public LobCreatingPreparedStatementCallBack(LobHandler lobHandler) {
4443
super(lobHandler);
4544

4645
}
4746

48-
public LobCreatingPreparedStatementCallBack(LobHandler lobHandler, List<AnnotationRetrevior.FieldContent> fields, BaseObject object) {
47+
public LobCreatingPreparedStatementCallBack(LobHandler lobHandler, List<AnnotationRetriver.FieldContent> fields, BaseObject object) {
4948
super(lobHandler);
5049
this.obj = object;
5150
this.fields = fields;
@@ -62,13 +61,13 @@ protected void setValues(PreparedStatement ps, LobCreator lobCreator)
6261
throws SQLException, DataAccessException {
6362
int pos = 1;
6463
try {
65-
for (AnnotationRetrevior.FieldContent field : fields) {
64+
for (AnnotationRetriver.FieldContent field : fields) {
6665
Object value = field.getGetMethod().invoke(obj, null);
6766
if (!field.isIncrement() && !field.isSequential() && value != null) {
6867
boolean needDo = true;
6968
if (field.isPrimary() && field.getPrimaryKeys() != null) {
7069
needDo = false;
71-
for (AnnotationRetrevior.FieldContent fieldContent : field.getPrimaryKeys()) {
70+
for (AnnotationRetriver.FieldContent fieldContent : field.getPrimaryKeys()) {
7271
setValueByDataType(ps, value, lobCreator, field.getDataType(), pos);
7372
pos++;
7473
}

core/src/main/java/com/robin/core/base/dao/SimpleJdbcDao.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public long queryByLong(final String sql) throws DAOException{
169169
Connection conn=getConnection();
170170
try{
171171
QueryRunner qRunner=new QueryRunner();
172-
ScalarHandler<Long> handler=new ScalarHandler<Long>(1);
172+
ScalarHandler<Long> handler=new ScalarHandler<>(1);
173173
return qRunner.query(conn, sql, handler);
174174
}catch(Exception ex){
175175
throw new DAOException(ex);
@@ -180,7 +180,7 @@ public long queryByLong(final String sql) throws DAOException{
180180
public static long queryByLong(final Connection conn,final String sql) throws DAOException{
181181
try{
182182
QueryRunner qRunner=new QueryRunner();
183-
ScalarHandler<Long> handler=new ScalarHandler<Long>(1);
183+
ScalarHandler<Long> handler=new ScalarHandler<>(1);
184184
return qRunner.query(conn, sql, handler);
185185
}catch(Exception ex){
186186
throw new DAOException(ex);
@@ -216,7 +216,7 @@ public int queryByInt(final String sql) throws DAOException{
216216
Connection conn=getConnection();
217217
try{
218218
QueryRunner qRunner=new QueryRunner();
219-
ScalarHandler<Integer> handler=new ScalarHandler<Integer>(1);
219+
ScalarHandler<Integer> handler=new ScalarHandler<>(1);
220220
return qRunner.query(conn, sql, handler);
221221
}catch(Exception ex){
222222
throw new DAOException(ex);
@@ -227,7 +227,7 @@ public int queryByInt(final String sql) throws DAOException{
227227
public static int queryByInt(final Connection conn,final String sql) throws DAOException{
228228
try{
229229
QueryRunner qRunner=new QueryRunner();
230-
ScalarHandler<Integer> handler=new ScalarHandler<Integer>(1);
230+
ScalarHandler<Integer> handler=new ScalarHandler<>(1);
231231
return qRunner.query(conn, sql, handler);
232232
}catch(Exception ex){
233233
throw new DAOException(ex);
@@ -396,7 +396,7 @@ public Serializable queryByHandler(final String sql,Object[] params,ResultSetHan
396396
}
397397
ResultSet rs=stmt.executeQuery();
398398
obj=handler.handle(rs);
399-
logger.info("ret count="+obj);
399+
logger.info("ret count={}",obj);
400400
return obj;
401401
}
402402
catch (Exception e) {
@@ -520,7 +520,6 @@ public static int executeUpdate(final Connection conn,final String sql,final Obj
520520
QueryRunner qRunner=new QueryRunner();
521521
return qRunner.update(conn,sql, param);
522522
}catch(Exception ex){
523-
//logger.error("",ex);
524523
throw new DAOException(ex);
525524
}
526525
}
@@ -660,11 +659,10 @@ public Boolean handle(ResultSet rs) throws SQLException {
660659
ResultSetMetaData meta=rs.getMetaData();
661660
int columncount=meta.getColumnCount();
662661
int successCount = 0;
663-
List<String> resultList=new ArrayList<String>();
662+
List<String> resultList=new ArrayList<>();
664663
try{
665664
while(rs.next()){
666665
for (int i = 0; i < columncount; i++) {
667-
//String columnName=meta.getColumnLabel(i+1);
668666
String type=DataBaseUtil.translateDbType(meta.getColumnType(i+1));
669667
Object obj=rs.getObject(i+1);
670668
if(rs.wasNull()){
@@ -716,7 +714,7 @@ public boolean importByFile(String columns,String tableName,String split,String
716714
} else {
717715
insertSqlbuilder.append(" values (");
718716
}
719-
final List<String> columnTypes=new ArrayList<String>();
717+
final List<String> columnTypes=new ArrayList<>();
720718
int columnCount=qRunner.query(conn, querySql, new ResultSetHandler<Integer>(){
721719
@Override
722720
public Integer handle(ResultSet rs) throws SQLException {
@@ -735,7 +733,7 @@ public Integer handle(ResultSet rs) throws SQLException {
735733
insertSqlbuilder.append("?)");
736734
}
737735
}
738-
List<Object[]> targetList=new ArrayList<Object[]>();
736+
List<Object[]> targetList=new ArrayList<>();
739737
String line=null;
740738
int linepos=1;
741739
String currDateFormat=dateFormat;

core/src/main/java/com/robin/core/base/dao/SqlMapperDao.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.springframework.jdbc.support.GeneratedKeyHolder;
1717
import org.springframework.jdbc.support.KeyHolder;
1818
import org.springframework.jdbc.support.lob.LobHandler;
19+
import org.springframework.util.Assert;
1920

2021
import javax.sql.DataSource;
2122
import java.lang.reflect.Method;
@@ -41,6 +42,7 @@ public SqlMapperDao(SqlMapperConfigure mapper, DataSource dataSource, BaseSqlGen
4142
setDataSource(dataSource);
4243
sqlMapperConfigure = mapper;
4344
this.sqlGen = sqlGen;
45+
Assert.notNull(getJdbcTemplate(),"");
4446
namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(getJdbcTemplate());
4547
}
4648

@@ -49,6 +51,7 @@ public SqlMapperDao(SqlMapperConfigure mapper, DataSource dataSource, BaseSqlGen
4951
sqlMapperConfigure = mapper;
5052
this.lobHandler = lobHandler;
5153
this.sqlGen = sqlGen;
54+
Assert.notNull(getJdbcTemplate(),"");
5255
namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(getJdbcTemplate());
5356
}
5457

@@ -132,7 +135,7 @@ public int executeByMapper(String nameSpace, String id, Object... targetObject)
132135
InsertSegment segment = (InsertSegment) pair.right.get(0);
133136
if (segment.isUseGenerateKeys()) {
134137
useGenerateKeys = true;
135-
keyProperty = ((InsertSegment) segment).getKeyProperty();
138+
keyProperty = segment.getKeyProperty();
136139
}
137140
}
138141
Map<String, Object> paramMap = wrapSqlAndParamter(nameSpace, id, builder, null, targetObject);

0 commit comments

Comments
 (0)