简体   繁体   中英

Auto choice of Spring annotation in IDEA

I have to add for example @Trancient annotation to my project by auto-replace some parts of my code. So now I have 100+ such annotations in 50+ files of the code.

During compilation IDEA every time asks me what exact annotation I would like use from: javax.persistence OR javax.beans OR ...

Is there any way to tell my IDE what exact package for annotation to use so it can auto-import them all?

Exclude the imports you don't need in Settings ( Preferences on Mac) | Editor | General | Auto Import , Exclude from Import and Completion :

排除

You can also exclude directly from the import popup by selecting the import you don't need and pressing the right arrow to open the submenu, then select the variant to exclude and press Enter :

排除弹出窗口

The main problem here is to not forget to remove the excluded class from the list if you plan to use it later.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM