이 블로그 검색

2011년 4월 28일 목요일

이벤트

이미지태그 <img> 에는 키보드 이벤트가 않됨.

<a>태그로 감싸거나 <div>태그로 감싸야함

2011년 4월 6일 수요일

2011년 4월 5일 화요일

JDO 객체에 null값과 "" 값

JDO 객체에 새로운 필드 추가시 기존데이터는
추가된 필드에 대해 null값을 가진다.
null체크를 해서 처리를 해주어야한다.

JDO 객체에 내용없는 ""을 저장했을 경우 null이 아니라 ""이다.

2011년 4월 3일 일요일

@SuppressWarnings("serial")

Hi, If your class implements the interface java.io.Serializeable, either directly or indirectly, you should provide a field called serialVersionUID. If you do not provide this field and compile the class, you will get a warning at compile time. If you do not want this warning, simply add the line @SupressWarnings("serial") before your class definition. Make sure, you use Java 5.0 in order to use annotations. HTH, - Günthe

2011년 4월 2일 토요일

local admin

http://googleappengine.blogspot.com/2009/07/google-app-engine-for-java-sdk-122.html: "At long last, the dev appserver has a data viewer. Start your app locally and point your browser tohttp://localhost:8888/_ah/admin to check it out."

child


public Item load() {
    PersistenceManager pm = PersistenceManagerFactoryGetter.get().getPersistenceManager();
    List<Data> datas = new ArrayList<Data>();
    Data data0 = null;
    try {
        Query q = pm.newQuery(Data.class);
        datas = (List<Data>) q.execute();
        if (datas.size() > 0)
            data0 = pm.detachCopy(datas.get(0)); // get first item only

    } finally {
        pm.close();
    }
    return data0.item;  // always null !!!!!
}

Hi,
I encounter problems while trying to implement GWT JDO features. Let's say there is a Data object that contains an Item object. In the datastore this would create a one-to-one relationship.
The problem is that when I try to get the object from the datastore, the 'item' field is always null. Of course I put the object to the datastore that contains the initalized Item object (end of the listing). When viewing the datastore, both Data and Item entities do exist.
Do I manage the one-to-one relationship wrong? What else is needed? The same situation is when I try to create one-to-many relatioship (an array of Item's)
Thanks for any hints.

Child objects aren't loaded with their parents because they are lazily loaded. The query.execute() doesn't return the child fields. They are only loaded if you try to access it (with a data0.getItem(), for instance). In your case, your're trying to access the child object after you close the PersistenceManager, so they're aren't loaded.

2011년 4월 1일 금요일

li태그 안에 img를 사용할때 img아래에 여백문제

ul {

    list-style: none;

    margin: 0; padding: 0;

    overflow: hidden;

}

ul li {

        display: block;

        line-height: 0;

        font-size: 0;

    }

ul li img {

            display: block;
        }