Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 0f7dce45e3bd2019fc2d7d229e9aaa0bd492726b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Martin Taal - initial api
 */
package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;

import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.event.internal.DefaultMergeEventListener;
import org.hibernate.persister.entity.EntityPersister;

import java.util.Map;

/**
 * The CDOMergeEventListener prevents copying of values of an existing entity to itself.
 */
public class CDOMergeEventListener extends DefaultMergeEventListener
{
  private static final long serialVersionUID = 1L;

  @SuppressWarnings("rawtypes")
  @Override
  protected void copyValues(final EntityPersister persister, final Object entity, final Object target,
      final SessionImplementor source, final Map copyCache)
  {
    if (entity != target)
    {
      super.copyValues(persister, entity, target, source, copyCache);
    }
  }
}

Back to the top