Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4631058

Browse filesBrowse files
committed
add->intellij && update->difference of spring annotation
1 parent 86bf225 commit 4631058
Copy full SHA for 4631058

File tree

Expand file treeCollapse file tree

2 files changed

+32
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+32
-3
lines changed
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## 如何让IntelliJ编辑器永久性显示代码行数
2+
3+
#### 问题
4+
5+
如何让IntelliJ编辑器永久性显示代码行数
6+
7+
#### 回答
8+
9+
##### <Strong>IntelliJ 14.0之后的版本</strong>
10+
11+
打开软件的菜单`File`->`Settings`->`Editor`->`General`->`Appearance`,在右侧的配置`Show line numbers`打勾:
12+
![image1][1]
13+
14+
##### <Strong>IntelliJ 8.1.2 - 13.X的版本</strong>
15+
16+
打开软件的菜单`File`->`Settings`->`Editor`->`Appearance`,在右侧的配置`Show line numbers`打勾:
17+
![images2][2]
18+
19+
#### 拓展
20+
21+
[IntelliJ IDEA 使用教程](http://www.phperz.com/article/15/0923/159068.html)
22+
23+
#### StackOverflow地址
24+
25+
http://stackoverflow.com/questions/13751/how-can-i-permanently-have-line-numbers-in-intellij
26+
27+
28+
[1]: http://i.stack.imgur.com/9DL9q.png
29+
[2]: http://i.stack.imgur.com/JVZlJ.jpg

‎contents/whats-the-difference-between-component-repository-service-annotations-in.md

Copy file name to clipboardExpand all lines: contents/whats-the-difference-between-component-repository-service-annotations-in.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
#### 问题
44

5-
在spring集成的框架中,注解在类上的`@Component``@Repository``@Service`等注解能否被互换?即这些注解的区别是什么
5+
在spring集成的框架中,注解在类上的`@Component``@Repository``@Service`等注解能否被互换?或者说这些注解有什么区别
66

77
#### 回答1
88

99
引用spring的官方文档中的一段描述:
1010

11-
在Spring2.0之前的版本中,`@Repository`注解可以标记在任何的类上,用来表明该类是用来执行与数据库相关的操作(即dao对象)
11+
在Spring2.0之前的版本中,`@Repository`注解可以标记在任何的类上,用来表明该类是用来执行与数据库相关的操作(即dao对象),并支持自动处理数据库操作产生的异常
1212

1313
在Spring2.5版本中,引入了更多的Spring类注解:`@Component`,`@Service`,`@Controller``Component`是一个通用的Spring容器管理的单例bean组件。而`@Repository`, `@Service`, `@Controller`就是针对不同的使用场景所采取的特定功能化的注解组件。
1414

1515
因此,当你的一个类被`@Component`所注解,那么就意味着同样可以用`@Repository`, `@Service`, `@Controller`来替代它,同时这些注解会具备有更多的功能,而且功能各异。
1616

1717
最后,如果你不知道要在项目的业务层采用`@Service`还是`@Component`注解。那么,`@Service`是一个更好的选择。
1818

19-
就如上文所说的,`@Repository`早已被支持了在你的持久层作为一个标记可以去自动处理数据库操作产生的异常(译者注:因为原生的java操作数据库所产生的异常只用了几种,但是产生的原因却有很多种,这样对于数据库操作的报错排查造成了一定的影响;而Spring拓展了原生的持久层异常,针对不同的产生原因有了更多的异常进行描述。所以,在注解了`@Repository`的类上如果数据库操作中抛出了异常,就能对其进行处理,转而抛出的是翻译后的spring专属数据库异常)。
19+
就如上文所说的,`@Repository`早已被支持了在你的持久层作为一个标记可以去自动处理数据库操作产生的异常(译者注:因为原生的java操作数据库所产生的异常只定义了几种,但是产生数据库异常的原因却有很多种,这样对于数据库操作的报错排查造成了一定的影响;而Spring拓展了原生的持久层异常,针对不同的产生原因有了更多的异常进行描述。所以,在注解了`@Repository`的类上如果数据库操作中抛出了异常,就能对其进行处理,转而抛出的是翻译后的spring专属数据库异常,方便我们对异常进行排查处理)。
2020

2121
| 注解 | 含义 |
2222
| ------------- |:-------------:|

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.