Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
질문 보충...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Greenxk  
View profile   Translate to Translated (View Original)
 More options Nov 5, 11:59 pm
From: Greenxk <gree...@gmail.com>
Date: Thu, 5 Nov 2009 20:59:02 -0800 (PST)
Local: Thurs, Nov 5 2009 11:59 pm
Subject: 질문 보충...
에 전에 질문한거 보충 좀 해드리자면 다음과 같은 구조 입니다.

---------------------------------------------
--KSUG의 무궁한 안녕을 빕니다.
------RE: 감사합니다
----------RE: 별 말씀을...
------RE: 저두요.
--오늘의 출석부 시작~
--------------------------------------------------

과 같이.. 계층형 게시판 같은 것을 만들려고 하는데...
SQL과 JDBC를 이용하여 이런 모양의 게시판을 만드는 법은 이미 알고 있습니다.

문제는 하이버네이트 같은 ORM 라이브러리로 어떻게 구조화 해야 좋을지를 잘 모르겠어요..
HQL이나 크리테리아로 저런 모양을 내는 방법이 있을지..

아니면, 그냥 SQL로 맵핑해서 만들어야 하는지 궁금하네요..
오라클이야.. 쿼리하나 잘 날려 주면 저런 모양은 식은 죽먹기이긴 한데..

하이버네이트는 자기가 알아서 쿼리랑 맵핑을 하니.. 이걸 어떻게 해야 하는지 감이 안옵니다.
방법 좀 가르쳐 주세요..ㅜ.ㅜ


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sewon Ann  
View profile   Translate to Translated (View Original)
 More options Nov 6, 12:25 am
From: Sewon Ann <king...@gmail.com>
Date: Fri, 6 Nov 2009 14:25:58 +0900
Local: Fri, Nov 6 2009 12:25 am
Subject: Re: 질문 보충...

"계층 리플" 이라는 기능이 아닌, 구현하고자 하는 업무에 대해 몰라서 딱히 원하시는 내용인지는 모르겠네요.

1. 한방 쿼리를 날려 잘 짜여진 result set 을 얻어서 그대로 화면에 뿌려준다.
2. 듬성한 쿼리를 날려 일단 result set을 얻고, 그걸 로직(java) 에서 재구성한 후 화면에 뿌려준다.

두 가지 접근방법이 있을 것 같습니다. 1번이라면 쿼리에 대해 고민을 많이 해야겠네요. 2번이라면, 그리고 계층적 접근을 리플에
한정한다면, 일단 article ID 에 해당하는 reply 들을 쫙 긁어온 후, reply 의 속성 중 parent_reply ID
등등의 내용으로 계층을 구성하면 되지 않을까요.

2번 이라면 hibernate 건 뭘 쓰건 쿼리는 아주 간단해 질 듯 합니다. 다만 로직 단에서 reply 자료구조를 잘 구성해 줘야
겠지요.

굳이 1번으로 가야하는 환경이 아니라면 2번 접근방법도 고려해보는 것이 어떨까요

2009/11/6 Greenxk <gree...@gmail.com>


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
백기선  
View profile   Translate to Translated (View Original)
 More options Nov 6, 12:28 am
From: 백기선 <whiteship2...@gmail.com>
Date: Fri, 6 Nov 2009 14:28:48 +0900
Local: Fri, Nov 6 2009 12:28 am
Subject: Re: 질문 보충...

도메인 클래스는 어떻게 생겼나요?

Object랑 Relation이 어떻게 맵핑되어 있는냐에 따라 HQL이나 Criteria를 어떻게 작성할지 생각날것 같은데요.

2009년 11월 6일 오후 1:59, Greenxk <gree...@gmail.com>님의 말:

--
좋은 하루 되세요~

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
신승한  
View profile   Translate to Translated (View Original)
 More options Nov 6, 12:33 am
From: 신승한 <my.p...@gmail.com>
Date: Fri, 6 Nov 2009 14:33:48 +0900
Local: Fri, Nov 6 2009 12:33 am
Subject: Re: 질문 보충...

하이버네이트를 사용하신 이상.. SQL로 어떻게 해볼려는 생각 보다는 2번이 좋을거 같네요.

저같은 경우 이렇게 해결했습니다.

   1. Connectable<ID extends Serializable,T> 이라는 인터페이스를 만들고.
   이 인터페이스를 구현한 놈을 리스트로 받아 입력하면 계층화 시켜주는 코드를 짭니다.
   (각 코드는 자신의 부모를 알고 있어야 하겠죠~ )

   2. 게시판을 만들때 Connectable를 구현(implements)하도록 합니다.

   3. 크리테리아로 원하는 구간만큼 단순히 리스트로 받아오기만 한 후 위의 API에 넣어서 WAS에서 계층화를 시켜줍니다.

사실.. 오라클 connect by 쓸때보다는 오래 걸리는게 사실이네요.

2009년 11월 6일 오후 2:25, Sewon Ann <king...@gmail.com>님의 말:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greenxk  
View profile   Translate to Translated (View Original)
 More options Nov 6, 1:34 am
From: Greenxk <gree...@gmail.com>
Date: Thu, 5 Nov 2009 22:34:32 -0800 (PST)
Local: Fri, Nov 6 2009 1:34 am
Subject: Re: 질문 보충...
음 도메인 클래스라긴 머하고...대충

private int id;
private int parent;
private String text;
private Date date;

이거 세계가 있고.. get,set 아쉽게 걍 생략하고..ㅡ.ㅡ;;

id 는 Key 이고

parent는 계층을 구현하기 위한 key 입니다. 그러니까 부모의 key를 가지고 있죠..

DB 테이블도 여기에 맞게 1:1로 만들었습니다.

음..... 될까요?


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
신승한  
View profile   Translate to Translated (View Original)
 More options Nov 6, 1:40 am
From: 신승한 <my.p...@gmail.com>
Date: Fri, 6 Nov 2009 15:40:49 +0900
Local: Fri, Nov 6 2009 1:40 am
Subject: Re: 질문 보충...

만약 하이버 네이트 쓰시면

class T{
  private int id;
  private T parent;
  private String text;
  private Date date;

}

이렇게 매핑될듯 합니다.

실제 parent가 로딩되어있지 않더라도 parent.getId() 하시면 부모키값을 얻을 수 있겠네요.

2009년 11월 6일 오후 3:34, Greenxk <gree...@gmail.com>님의 말:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
백기선  
View profile   Translate to Translated (View Original)
 More options Nov 6, 1:43 am
From: 백기선 <whiteship2...@gmail.com>
Date: Fri, 6 Nov 2009 15:43:59 +0900
Local: Fri, Nov 6 2009 1:43 am
Subject: Re: 질문 보충...

왜 parent가 int 타입이죠?

2009년 11월 6일 오후 3:34, Greenxk <gree...@gmail.com>님의 말:

--
좋은 하루 되세요~

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Toby Lee  
View profile   Translate to Translated (View Original)
 More options Nov 6, 1:56 am
From: Toby Lee <tobyi...@gmail.com>
Date: Fri, 6 Nov 2009 16:56:23 +1000
Local: Fri, Nov 6 2009 1:56 am
Subject: Re: 질문 보충...

Oracle의 특별한 쿼리를 써야 하는 parent - child 재귀 구조보다는 rootid, depth, order 같은 방식의
1차원 DB구조로 계층 구조를 구현하시면 간단한 쿼리로도 한방에 읽어올 수 있습니다.

2009/11/6 백기선 <whiteship2...@gmail.com>


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greenxk  
View profile   Translate to Translated (View Original)
 More options Nov 6, 1:56 am
From: Greenxk <gree...@gmail.com>
Date: Thu, 5 Nov 2009 22:56:43 -0800 (PST)
Local: Fri, Nov 6 2009 1:56 am
Subject: Re: 질문 보충...
그게.. id키 값을 가지는 값 자체가 int 이기도 하고..
부모의 키값을 가지는 파라미터라.. int로 했는데..

JDBC로 구현할때는 이렇게 구현하다 보니...

근데...
신승한님이 다시 짜준 소스를 보니 머리가 번쩍하기도 하네요...음..ㅡ.ㅡ;;

좀더 진한 정보를...ㅜ.ㅜ


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google