beginTransaction(db);
try
{
Repository repository = RepositoryController.getController().getRepositoryWithId(repositoryId, db);
deleteRepositoryLanguages(repository, db);
//add validation here if needed
List repositoryLanguageList = new ArrayList();
if(languageValues != null)
{
for (int i=0; i < languageValues.length; i++)
{
Language language = LanguageController.getController().getLanguageWithId(new Integer(languageValues[i]), db);
RepositoryLanguage repositoryLanguage = create(repository.getId(), new Integer(languageValues[i]), new Integer(i), db);
repositoryLanguageList.add(repositoryLanguage);
}
}
//repository = RepositoryController.getController().getRepositoryWithId(repositoryVO.getRepositoryId(), db);
//repository.setValueObject(repositoryVO);
repository.setRepositoryLanguages(repositoryLanguageList);
//If any of the validations or setMethods reported an error, we throw them up now before create.
ceb.throwIfNotEmpty();
commitTransaction(db);