class ServiceApiRefServiceImpl extends AbstractApiRefService implements ServiceApiRefService {

	@Transactional
	@Override
	public <T extends ApiObject> void save(Integer apiRepoId, RefData<T> refData) {
		ApiRepoVersion apiRepoVersion = saveApiRepoVersion(apiRepoId, refData);
		
		if(refData.getShortRefName().equals("master")) {
			clearRefSchemas(apiRepoVersion.getId());
			clearRefApis(apiRepoVersion.getId());
		}
		saveSchemas(apiRepoVersion, refData.getSchemas(), refData.getCreateUserId());
		saveApiServices(apiRepoVersion, refData);
	}

}