<p>I am trying to let a piece of runtime state decide WHICH implementation of an interface to use, preferably solely by autowiring. </p>

<p>I have tried making an object factory for the interface thet uses dynamic proxies, and I used qualifiers to coerce the @Autowired injections to use the factory. The qualifiers are necessary because both the factory and the implementations respond to the same interface.</p>

<p>The problem with this is that I end up annotating every @Autowired reference with the @Qualifier. What I'd really want to do is annotate the non-factory implementations with something like @NotCandidateForAutowiringByInterface (my fantasy annotation), or even better make spring prefer the single un-qualified bean when injecting to an un-qualified field </p>

<p>I may thinking along the totally wrong lines here, so alternate suggestions are welcome.
Anyone know how to make this happen ?</p>

I think you would be better using format strings
```
```
string myVar = "0";
string sql = String.Format(@"select * from tblname where test = \"{0}\"", myVar);
```
```
You should also ask yourself why you are generating inline SQL on the fly and not using stored procedures as this is how SQL injection attacks can occur unless you sanitize the input.