728x90

myBatis 반복문

 

open="("      : 반복시 '('로 시작

close=")"     : 반복시 ')'로 끝남

prepend       : 'WHERE' 과 같이 iterate 문 앞에 첨가

<select id="selectPostIn" parameterType="map">
  SELECT *
  FROM POST P
  WHERE ID in
  <foreach collection="list" item="item" index="index" 
      open="(" separator="," close=")">
        #{item}
  </foreach>
</select>

 

collection : 전달받은 인자값 이름(변수 이)

item : foreach 문 안에서 사용할 매개변수 이

separator : foreach 문이 한번 돌고 다음번 돌때의 구분자



Reference:

mingggu.tistory.com/71

java119.tistory.com/85

 

728x90
728x90

이클립스 실행하자마자 응답 없음에 걸릴 경우

 

 

1. STS실행파일과 같은 위치에 있는 'STS.init'파일에 본인 컴퓨터의 JAVA PATH를 추가

 

-vm

C:\Program Files\Java\jre1.8.0_171\bin\javaw.exe

 

(*vmargs 위에 추가)

 

 

2. 내가 해결본 방법

최근 실행한 프로젝트의 설정값이 남아서 에러가 나는 것이므로,

workspace를 재구성하기 위해 Package Explorer를 완전히 비우고(실제 소스파일들을 삭제하란 소리는 아님),

프로젝트 파일들을 다시 불러오자

 

 

 

estrella-0707.tistory.com/11

http://dev.azki.org/42

http://off-topic.biz/en/eclipse-hangs-at-startup-showing-only-the-splash-screen/

 

 

 

728x90
728x90

Platform 관련 함수는 웹에서 사용이 불가능한 모양

 

 

사용하지 않거나,

그럼에도 불구하고 사용하고싶으면 try-catch 감싸라는 이야기 존재

 

 

//You can use a try-catch block to prevent the exception from breaking the flow:

bool kisweb;
try{
    if(Platform.isAndroid||Platform.isIOS) {
        kisweb=false;
    } else {
        kisweb=true;
    }
} catch(e){
    kisweb=true;
}



 

Reference

https://stackoverflow.com/questions/58459483/unsupported-operation-platform-operatingsystem

 

Unsupported operation: Platform._operatingSystem

My flutter code isn't running on web. I found that "bool kisweb" can be used to detect the platform. But my code is failing at "FirebaseAuth.instance". Does this mean I can't use Firebaseauth on ...

stackoverflow.com

 

728x90

'Dev > Flutter' 카테고리의 다른 글

[Flutter/Dart] .. (Double dot/이중점) 연산자 - cascade  (0) 2021.01.15
[Flutter] 플러터로 Web하기  (0) 2020.09.07
728x90

 

Flutter의 Dart에서 함수 호출시 ".." 을 사용하는 경우가 있다.

이는 동일한 객체에 대해 여러 메소드를 호출하려할 때 간략하게 쓰는 것임.

즉, 동일한 타겟을 반복하지 않아도 되도록 하는 것

ex)
list.add(color1);
list.add(color2);
list.add(color3);
list.add(color4);

// with cascade

List list = [];
list
  ..add(color1)
  ..add(color2)
  ..add(color3)
  ..add(color4);
//It's the cascade operator of Dart

var l1 = new List<int>()..add(0)..addAll([1, 2, 3]);

//results in l1 being a list [0, 1, 2, 3]

var l1 = new List<int>().add(0).addAll([1, 2, 3]);

 

 

results in an error, because .add(0) returns void

.. (in the former example) refers to new List(), while . (in the later) refers to the return value of the previous part of the expression.

.. was introduced to avoid the need to return this in all kinds of methods like add() to be able to use an API in a fluent way.

.. provides this out of the box for all classes.

 

 

Reference

stackoverflow.com/questions/49447736/list-use-of-double-dot-in-dart

 

List use of double dot (.) in dart?

Sometimes I see this List list = []; Then list..add(color) Whats the difference in using 1 dot(.) and 2 dot(..)?

stackoverflow.com

 

728x90

'Dev > Flutter' 카테고리의 다른 글

[Flutter/web] Platform 함수 에러 관련  (0) 2021.01.15
[Flutter] 플러터로 Web하기  (0) 2020.09.07

+ Recent posts