Skip to content

Instantly share code, notes, and snippets.

@baybatu
Created January 24, 2017 09:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save baybatu/0c4b9b41ed6981382b602633b88428c6 to your computer and use it in GitHub Desktop.
Save baybatu/0c4b9b41ed6981382b602633b88428c6 to your computer and use it in GitHub Desktop.
Spring managed olmayan yerden spring bean almak
@Override
public boolean isValid(Long currencyId, ConstraintValidatorContext context) {
BaseApplicationScope baseApplicationScope = SpringApplicationContext.getBean(BaseApplicationScope.class);
return baseApplicationScope != null && baseApplicationScope.getCurrencyBy(currencyId) != null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment