@@ -78,28 +78,17 @@ public Concept mapRow(final ResultSet resultSet, final int arg1) throws SQLExcep
78
78
@ POST
79
79
@ Produces (MediaType .APPLICATION_JSON )
80
80
@ Consumes (MediaType .APPLICATION_JSON )
81
- public Collection <Concept > executeIdentifierLookup (@ PathParam ("sourceKey" ) String sourceKey , String [] identifiers ) {
81
+ public Collection <Concept > executeIdentifierLookup (@ PathParam ("sourceKey" ) String sourceKey , long [] identifiers ) {
82
82
if (identifiers .length == 0 ) {
83
83
return new ArrayList <>();
84
84
}
85
85
86
- int [] intIdentifiers =new int [identifiers .length ];
87
- int i =0 ;
88
- for (String identifier :identifiers ){
89
- try {
90
- intIdentifiers [i ]=Integer .parseInt (identifier );
91
- i ++;
92
- } catch (NumberFormatException e ) {
93
- throw new IllegalArgumentException ("Not a number: " + identifier + " at index " + i , e );
94
- }
95
- }
96
-
97
86
Source source = getSourceRepository ().findBySourceKey (sourceKey );
98
87
String tableQualifier = source .getTableQualifier (SourceDaimon .DaimonType .Vocabulary );
99
88
100
89
String sql_statement = ResourceHelper .GetResourceAsString ("/resources/vocabulary/sql/lookupIdentifiers.sql" );
101
90
sql_statement = SqlRender .renderSql (sql_statement , new String []{"identifiers" , "CDM_schema" }, new String []{
102
- JoinArray (intIdentifiers ), tableQualifier });
91
+ JoinArray (identifiers ), tableQualifier });
103
92
sql_statement = SqlTranslate .translateSql (sql_statement , "sql server" , source .getSourceDialect ());
104
93
105
94
return getSourceJdbcTemplate (source ).query (sql_statement , this .rowMapper );
@@ -146,7 +135,7 @@ public Collection<Concept> executeSourcecodeLookup(@PathParam("sourceKey") Strin
146
135
@ POST
147
136
@ Produces (MediaType .APPLICATION_JSON )
148
137
@ Consumes (MediaType .APPLICATION_JSON )
149
- public Collection <Concept > executeMappedLookup (@ PathParam ("sourceKey" ) String sourceKey , String [] identifiers ) {
138
+ public Collection <Concept > executeMappedLookup (@ PathParam ("sourceKey" ) String sourceKey , long [] identifiers ) {
150
139
if (identifiers .length == 0 ) {
151
140
return new ArrayList <>();
152
141
}
@@ -511,16 +500,7 @@ public Collection<Concept> getRelatedConcepts(@PathParam("sourceKey") String sou
511
500
512
501
ArrayList <String > filterList = new ArrayList <String >();
513
502
514
- int [] conceptIds =new int [search .conceptId .length ];
515
- int i =0 ;
516
- for (String conceptId : search .conceptId ) {
517
- try {
518
- conceptIds [i ] = Integer .parseInt (conceptId );
519
- i ++;
520
- } catch (NumberFormatException e ) {
521
- throw new IllegalArgumentException ("Not a number: " + conceptId + " at index " + i , e );
522
- }
523
- }
503
+ long [] conceptIds = search .conceptId ;
524
504
525
505
if (search .vocabularyId != null && search .vocabularyId .length > 0 ) {
526
506
filterList .add ("VOCABULARY_ID IN (" + JoinArray (search .vocabularyId ) + ")" );
@@ -565,7 +545,7 @@ public Void mapRow(ResultSet resultSet, int arg1) throws SQLException {
565
545
return concepts .values ();
566
546
}
567
547
568
- private String JoinArray (final int [] array ) {
548
+ private String JoinArray (final long [] array ) {
569
549
String result = "" ;
570
550
571
551
for (int i = 0 ; i < array .length ; i ++) {
0 commit comments