SchemaId id;
if (recordType.getId() == null) {
// Map the name to id
RecordType existingType = getRecordTypeFromCache(recordType.getName(), recordType.getVersion());
if (existingType == null) {
throw new RecordTypeNotFoundException(recordType.getName(), null);
} else {
id = existingType.getId();
}
} else {
id = recordType.getId();
}
RecordType newRecordType = recordType.clone();
newRecordType.setId(id);
byte[] rowId = id.getBytes();
byte[] nameBytes = null;
Long now = null;
try {
// Do an exists check first
if (!getTypeTable().exists(new Get(rowId))) {
throw new RecordTypeNotFoundException(recordType.getId(), null);
}
// Only do the concurrency check when a name was given
QName name = recordType.getName();
if (name != null) {