DataSqlMapper
This commit is contained in:
@@ -3,12 +3,10 @@
|
||||
*/
|
||||
package org.redkale.test.source.parser;
|
||||
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.redkale.source.DataSqlMapper;
|
||||
import org.redkale.source.SourceException;
|
||||
import org.redkale.util.TypeToken;
|
||||
import org.redkale.source.DataJdbcSource;
|
||||
import org.redkale.source.DataSqlSource;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -16,24 +14,21 @@ import org.redkale.util.TypeToken;
|
||||
*/
|
||||
public class DataSqlMapperTest {
|
||||
|
||||
private static DataSqlSource source = new DataJdbcSource();
|
||||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
DataSqlMapperTest test = new DataSqlMapperTest();
|
||||
test.init();
|
||||
test.run();
|
||||
|
||||
System.out.println(entityType(ForumInfoMapper.class));
|
||||
}
|
||||
|
||||
private static Class entityType(Class mapperType) {
|
||||
for (Type t : mapperType.getGenericInterfaces()) {
|
||||
if (DataSqlMapper.class.isAssignableFrom(TypeToken.typeToClass(t))) {
|
||||
return TypeToken.typeToClass(((ParameterizedType) t).getActualTypeArguments()[0]);
|
||||
}
|
||||
}
|
||||
throw new SourceException("Not found entity class from " + mapperType.getName());
|
||||
@BeforeAll
|
||||
public static void init() throws Exception {
|
||||
//do
|
||||
}
|
||||
|
||||
@Test
|
||||
public void run() throws Exception {
|
||||
|
||||
//do
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user