/** * Set unique data on the given mapping info. */ private void parseUnique(FieldMapping fm, org.apache.openjpa.persistence.jdbc.Unique anno) { ValueMappingInfo info = fm.getValueInfo(); if (!anno.enabled()) { info.setCanUnique(false); return; } org.apache.openjpa.jdbc.schema.Unique unq = new org.apache.openjpa.jdbc.schema.Unique(); if (!StringUtils.isEmpty(anno.name())) unq.setName(anno.name()); unq.setDeferred(anno.deferred()); info.setUnique(unq); }
/** * Set unique data on the given mapping info. */ private void parseUnique(FieldMapping fm, org.apache.openjpa.persistence.jdbc.Unique anno) { ValueMappingInfo info = fm.getValueInfo(); if (!anno.enabled()) { info.setCanUnique(false); return; } org.apache.openjpa.jdbc.schema.Unique unq = new org.apache.openjpa.jdbc.schema.Unique(); if (!StringUtils.isEmpty(anno.name())) unq.setIdentifier(DBIdentifier.newIndex(anno.name(), delimit())); unq.setDeferred(anno.deferred()); info.setUnique(unq); }
/** * Set unique data on the given mapping info. */ private void parseUnique(FieldMapping fm, org.apache.openjpa.persistence.jdbc.Unique anno) { ValueMappingInfo info = fm.getValueInfo(); if (!anno.enabled()) { info.setCanUnique(false); return; } org.apache.openjpa.jdbc.schema.Unique unq = new org.apache.openjpa.jdbc.schema.Unique(); if (!StringUtil.isEmpty(anno.name())) unq.setIdentifier(DBIdentifier.newIndex(anno.name(), delimit())); unq.setDeferred(anno.deferred()); info.setUnique(unq); }
/** * Set unique data on the given mapping info. */ private void parseUnique(FieldMapping fm, org.apache.openjpa.persistence.jdbc.Unique anno) { ValueMappingInfo info = fm.getValueInfo(); if (!anno.enabled()) { info.setCanUnique(false); return; } org.apache.openjpa.jdbc.schema.Unique unq = new org.apache.openjpa.jdbc.schema.Unique(); if (!StringUtil.isEmpty(anno.name())) unq.setIdentifier(DBIdentifier.newIndex(anno.name(), delimit())); unq.setDeferred(anno.deferred()); info.setUnique(unq); }