Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.examples.hibernate.server/src/org/eclipse/emf/cdo/examples/hibernate/server/CDOExampleUUIDHexGenerator.java')
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.hibernate.server/src/org/eclipse/emf/cdo/examples/hibernate/server/CDOExampleUUIDHexGenerator.java42
1 files changed, 0 insertions, 42 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples.hibernate.server/src/org/eclipse/emf/cdo/examples/hibernate/server/CDOExampleUUIDHexGenerator.java b/plugins/org.eclipse.emf.cdo.examples.hibernate.server/src/org/eclipse/emf/cdo/examples/hibernate/server/CDOExampleUUIDHexGenerator.java
deleted file mode 100644
index 0ed7e768e7..0000000000
--- a/plugins/org.eclipse.emf.cdo.examples.hibernate.server/src/org/eclipse/emf/cdo/examples/hibernate/server/CDOExampleUUIDHexGenerator.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2010-2013, 2015 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
- * Eike Stepper - maintenance
- */
-
-package org.eclipse.emf.cdo.examples.hibernate.server;
-
-import org.hibernate.engine.spi.SessionImplementor;
-import org.hibernate.id.UUIDHexGenerator;
-import org.hibernate.persister.entity.EntityPersister;
-
-import java.io.Serializable;
-
-/**
- * An example of overriding the standard UUID generator of Hibernate to prevent it overwriting an already existing id in
- * an object.
- *
- * @author mtaal
- */
-
-public class CDOExampleUUIDHexGenerator extends UUIDHexGenerator
-{
- @Override
- public Serializable generate(SessionImplementor session, Object obj)
- {
- final EntityPersister entityPersister = session.getEntityPersister(null, obj);
- final Serializable id = entityPersister.getIdentifier(obj, session);
- if (id != null)
- {
- return id;
- }
-
- return super.generate(session, obj);
- }
-}

Back to the top