Created
November 28, 2013 12:23
-
-
Save mystelynx/7691047 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<beans:bean id="SQLs" class="java.util.EnumMap"> | |
<constructor-arg> | |
<util:map> | |
<entry> | |
<key> | |
<util:constant static-field="some.package.SQLKEY.BARからの抽出" /> | |
</key> | |
<value type="java.lang.String"> | |
<![CDATA[ | |
select * from bar; | |
]]> | |
</value> | |
</entry> | |
<entry> | |
<key> | |
<util:constant static-field="some.package.SQLKEY.FOOからの抽出" /> | |
</key> | |
<value type="java.lang.String"> | |
<![CDATA[ | |
select * from foo; | |
]]> | |
</value> | |
</entry> | |
</util:map> | |
</constructor-arg> | |
</beans:bean> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeClass { | |
@Autowired | |
@Qualifier("SQLs") | |
EnumMap<SQLKEY, String> SQLs; | |
public void someMethod() { | |
String sql = SQLs.get(SQLKEY.FOOからの抽出); | |
... | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum SQLKEY { | |
BARからの抽出, | |
FOOからの抽出, | |
; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment