@Override
	public void enableAutoNaming() {
		if (isAutoNamed()) {
			return;
		}
		lock.acquire();
		try {
			checkDeleted();

			String oldName = getName();

			setFlags(getFlags() | TypedefDBAdapter.TYPEDEF_FLAG_AUTONAME);
			adapter.updateRecord(record, true);

			// auto-named typedef follows category of associated datatype 
			CategoryPath oldPath = getCategoryPath();
			CategoryPath currentPath = getDataType().getCategoryPath();

			String newName = generateTypedefName(currentPath);
			record.setString(TypedefDBAdapter.TYPEDEF_NAME_COL, newName);
			adapter.updateRecord(record, true);
			refreshName();

			if (!currentPath.equals(oldPath)) {
				// update category for typedef
				try {
					super.setCategoryPath(currentPath);
				}
				catch (DuplicateNameException e) {
					// should not happen
				}
			}

			notifyNameChanged(oldName);
		}
		catch (IOException e) {
			dataMgr.dbError(e);
		}
		finally {
			lock.release();
		}
	}
Construct TypeDefDB instance
@param dataMgr datatype manager
@param cache DataTypeDB cache
@param adapter TypeDef record adapter
@param record TypeDefDB record
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/TypedefDB.java