[원문] : http://blog.springsource.org/2010/01/25/ajax-simplifications-in-spring-3-0/

이올린에 북마크하기(0) 이올린에 추천하기(0)
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/464

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/464

 group by 절을 사용 할 때 , row 개수를 알 고 싶다면,
mysql count (distinct uid)  다음과 같이 사용 하면 된다 .
중복된 uid의 개수를 알 수 있다.

이올린에 북마크하기(0) 이올린에 추천하기(0)
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/463

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/463

Currently multiple parameters must be declared in the mapper interface using @Param annotation:

public interface SomeMapper {
    public SomeClass getWith2Params(@Param("p1") int p1, @Param("p2") String p2);
}

And then in mapper file:

<select id="getWith2Params" resultType="SomeClass">
        SELECT *
        FROM SomeTable
        WHERE p1 = #{p1} AND p2= #{p2}
</select>

Unlike single parameter, multiple parameters are not declared in the same place where they are used and this makes the coding less productive,
maintainable and readable.

An alternative to annotation for having full declaration and usage in the mapper file would be something like:

<select id="getWith2Params" parameters="int p1; string p2" resultType="SomeClass">
        SELECT *
        FROM SomeTable
        WHERE p1 = #{p1} AND p2= #{p2}
</select>

or

<select id="getWith2Params" parameters="int; string" resultType="MyClass">
        SELECT *
        FROM SomeTable
        WHERE p1 = #{1} AND p2= #{2}
</select>

This way all information regarding the query is kept in one simple
place, the mapper file, and no annotation would be required.

------------

@Param usage may also be simplified overriding it with a no-argument version:

public interface SomeMapper {
    public SomeClass getWith2Params(@Param int p1, @Param String p2);
}

And using parameter position in the query:

<select id="getWith2Params" resultType="SomeClass">
        SELECT *
        FROM SomeTable
        WHERE p1 = #{1} AND p2= #{2}
</select>

Or even (if possible) extracting the name of the parameters from @Param annotation:

<select id="getWith2Params" resultType="SomeClass">
        SELECT *
        FROM SomeTable
        WHERE p1 = #{p1} AND p2= #{p2}
</select>

instead of repeat declaring the name of the parameter.




이올린에 북마크하기(0) 이올린에 추천하기(0)
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/462

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/462

In mybatis passing array list is as simple as passing a map into

please follow the below codes

Any Dao method like

   List<domain.blog.Post> selectPostIn ( List<String> params );

And the Dao.xml
<select id="selectPostIn" resultType="domain.blog.Post"  parameterType="java.util.List">
 SELECT * FROM POST P WHERE ID in
    <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
      #{item}
    </foreach>
</select>
Just make sure collection name should be "list" only
You can pass a List instance or an Array to MyBatis as a parameter object. When you do, MyBatis will automatically wrap it in a Map, and key it by name. List instances will be keyed to the name “list” and array instances will be keyed to the name “array”

I have tried with list its working
이올린에 북마크하기(0) 이올린에 추천하기(0)
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/461

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/461

 Description

 Size for iPhone and iPod touch(in pixels)

 Size for iPad (in pixels)

 Application icon (required)

 57 x 57

 114 x 114 (high resolution)

 72 x 72

 App Store icon (required)

 512 x 512

 512 x 512

 Small icon for Spotlight

search results and Settings

(recommended)

 29 x 29

 58 x 58 (high resolution)

 50 x 50 for Spotlight search results

 29 x 29 for Settings

 Document icon

(recommended for custom

document types)

 22 x 29

 44 x 58 (high resolution)

 64 x 64

 320 x 320

 Web Clip icon

(recommended for web

applications and websites)

 57 x 57

 114 x 114 (high resolution)

 72 x 72

 Toolbar and navigation bar

icon (optional)

 Approximately 20 x 20

 Approximately 40 x 40 (high resolution)

 Approximately 20 x 20

 Tab bar icon (optional)

 Approximately 30 x 30

 Approximately 60 x 60 (high resolution)

 Approximately 30 x 30

 Launch image (required)

 320 x 480

 640 x 960 (high resolution)

 For Portrait: 768 x 1004

 For landscape: 1024 x 748


이올린에 북마크하기(0) 이올린에 추천하기(0)
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/460

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/460

xcode, background 실행방지

iphone RSS Icon ATOM Icon 2012/02/20 21:49 visualp

plist 파일을 열어
Application does not run in background  항목을 YES 로 설정한다.

어플리케이션이 강제 종료 되더라도 백그라운드에서 돌지 않는다.

이올린에 북마크하기(0) 이올린에 추천하기(0)
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/459

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/459

[원문]:  http://explainextended.com/2009/07/20/hierarchical-data-in-mysql-parents-and-children-in-one-query/
[원문] : http://blog.naver.com/PostView.nhn?blogId=justis1&logNo=40091860278

Oracle에서는 Connect by로 쉽게 해결되는데 Mysql에서는 고생하시는 분 많으 실것 같아서 올립니다

 

Mysql 계층 구조 (Tree 구조)에서

테이블 구조가 아래와 같은 경우

 

 ID  PARENT_ID ETC
 1 0 ROOT
 2 1

CHILD

 3 2 CHILD OF 2
 4 2 CHILD OF 2
 5 2

CHILD OF 2

Depth가 깊어 질수록 부모노드를 찾기가 힘들어 진다 . 이럴 경우 특정 자식 노드에서 Root까지의 부모노드를 가져오고 싶은 경우 아래의 쿼리를 사용하면 쉽게 해결된다.

 SELECT @r as _ID,
      (
        SELECT @r := PARENT_ID FROM TABLE WHERE ID = _ID
      ) AS _PARENT_ID, @l := @l + 1 AS level
      FROM (
        SELECT @r := 5
      ) vars, TABLE h
      WHERE @r <> 0
   
     )A, TABLE B

 

결과

 _ID

PARENT_ID LEVEL
 1  0  1
 2  1  2
 5  2  3
이올린에 북마크하기(0) 이올린에 추천하기(0)
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/458

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/458

spring 3.0 utf-8 filter

spring framework RSS Icon ATOM Icon 2012/02/17 10:48 visualp

web.xml에 추가해주세요

<filter>
  <filter-name>encodingFilter</filter-name>
  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
   <param-name>encoding</param-name>
   <param-value>UTF-8</param-value>
  </init-param>
  <init-param>
   <param-name>forceEncoding</param-name>
   <param-value>true</param-value>
  </init-param>
 </filter>
 <filter-mapping>
  <filter-name>encodingFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>

이올린에 북마크하기(0) 이올린에 추천하기(0)
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/457

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/457

mysql TIMESTAMP

Mysql RSS Icon ATOM Icon 2012/02/17 10:32 visualp

MYSQL  TIMESTAMP 사용 방법
TIMESTAMP DEFAULT Now()

이올린에 북마크하기(0) 이올린에 추천하기(0)
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/456

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/456

subeclipse 업데이트 주소

JSP, JAVA RSS Icon ATOM Icon 2012/02/13 16:46 visualp
http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA


[eclipse svn update url]
http://subclipse.tigris.org/update_1.6.x
이올린에 북마크하기(0) 이올린에 추천하기(0)
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/455

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/455