Example usage for org.hibernate.id UUIDGenerator subclass-usage

List of usage examples for org.hibernate.id UUIDGenerator subclass-usage

Introduction

In this page you can find the example usage for org.hibernate.id UUIDGenerator subclass-usage.

Usage

From source file org.openbravo.base.session.DalUUIDGenerator.java

/**
 * Extends the standard Hibernate UUIDGenerator. This is needed because:
 * <ul>
 * <li>the standard Hibernate UUIDGenerator will overwrite the id even if the object already has
 * one. The goal is to try to keep an id if it has been assigned to an object. This is important in
 * case of imports.</li>

From source file org.openlmis.referencedata.util.ConditionalUuidGenerator.java

public class ConditionalUuidGenerator extends UUIDGenerator {

    @Override
    public Serializable generate(SessionImplementor session, Object object) {
        if ((((BaseEntity) object).getId()) == null) {
            return super.generate(session, object);