Example usage for org.hibernate.collection.internal PersistentList clear

List of usage examples for org.hibernate.collection.internal PersistentList clear

Introduction

In this page you can find the example usage for org.hibernate.collection.internal PersistentList clear.

Prototype

@Override
    @SuppressWarnings("unchecked")
    public void clear() 

Source Link

Usage

From source file:com.corvid.json.hibernate.usertype.JsonListUserType.java

License:Apache License

@Override
public Object replaceElements(Object original, Object target, CollectionPersister persister, Object owner,
        @SuppressWarnings("rawtypes") Map copyCache, SessionImplementor session) throws HibernateException {

    PersistentList originalList = cast(original);
    PersistentList targetList = cast(target);
    targetList.clear();
    targetList.addAll(originalList);//  w  w w .ja  v a  2  s.c om

    return target;
}