- ubuntu12.04环境下使用kvm ioctl接口实现最简单的虚拟机
- Ubuntu 通过无线网络安装Ubuntu Server启动系统后连接无线网络的方法
- 在Ubuntu上搭建网桥的方法
- ubuntu 虚拟机上网方式及相关配置详解
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.
这篇CFSDN的博客文章iBatis习惯用的16条SQL语句由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.
iBatis 简介:
iBatis 是apache 的一个开源项目,一个O/R Mapping 解决方案,iBatis 最大的特点就是小巧,上手很快。如果不需要太多复杂的功能,iBatis 是能够满足你的要求又足够灵活的最简单的解决方案,现在的iBatis 已经改名为Mybatis 了.
官网为:http://www.mybatis.org/ 。
1.输入参数为单个值 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<delete id=
"com.fashionfree.stat.accesslog.deleteMemberAccessLogsBefore"
parameterClass=
"long"
>
delete from
MemberAccessLog
where
accessTimestamp = #value#
</delete>
<delete id=
"com.fashionfree.stat.accesslog.deleteMemberAccessLogsBefore"
parameterClass=
"long"
>
delete from
MemberAccessLog
where
accessTimestamp = #value#
</delete>
|
2.输入参数为一个对象 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<insert id=
"com.fashionfree.stat.accesslog.MemberAccessLog.insert"
parameterClass="com.fashionfree.stat.accesslog.model.MemberAccessLog>
insert into MemberAccessLog
(
accessLogId, memberId, clientIP,
httpMethod, actionId, requestURL,
accessTimestamp, extend1, extend2,
extend3
)
values
(
#accessLogId#, #memberId#,
#clientIP#, #httpMethod#,
#actionId#, #requestURL#,
#accessTimestamp#, #extend1#,
#extend2#, #extend3#
)
</insert>
<insert id=
"com.fashionfree.stat.accesslog.MemberAccessLog.insert"
parameterClass="com.fashionfree.stat.accesslog.model.MemberAccessLog>
insert into MemberAccessLog
(
accessLogId, memberId, clientIP,
httpMethod, actionId, requestURL,
accessTimestamp, extend1, extend2,
extend3
)
values
(
#accessLogId#, #memberId#,
#clientIP#, #httpMethod#,
#actionId#, #requestURL#,
#accessTimestamp#, #extend1#,
#extend2#, #extend3#
)
</insert>
|
3.输入参数为一个java.util.HashMap 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<select id=
"com.fashionfree.stat.accesslog.selectActionIdAndActionNumber"
parameterClass=
"hashMap"
resultMap=
"getActionIdAndActionNumber"
>
select
actionId, count(*) as count
from
MemberAccessLog
where
memberId = #memberId#
and accessTimestamp > #start#
and accessTimestamp <= #end#
group by actionId
</select>
<select id=
"com.fashionfree.stat.accesslog.selectActionIdAndActionNumber"
parameterClass=
"hashMap"
resultMap=
"getActionIdAndActionNumber"
>
select
actionId, count(*) as count
from
MemberAccessLog
where
memberId = #memberId#
and accessTimestamp > #start#
and accessTimestamp <= #end#
group by actionId
</select>
|
4.输入参数中含有数组 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<insert id=
"updateStatusBatch"
parameterClass=
"hashMap"
>
update
Question
set
status = #status#
<dynamic prepend=
"where questionId in"
>
<isNotNull property=
"actionIds"
>
<iterate property=
"actionIds"
open=
"("
close=
")"
conjunction=
","
>
#actionIds[]#
</iterate>
</isNotNull>
</dynamic>
</insert>
<insert id=
"updateStatusBatch"
parameterClass=
"hashMap"
>
update
Question
set
status = #status#
<dynamic prepend=
"where questionId in"
>
<isNotNull property=
"actionIds"
>
<iterate property=
"actionIds"
open=
"("
close=
")"
conjunction=
","
>
#actionIds[]#
</iterate>
</isNotNull>
</dynamic>
</insert>
|
说明:actionIds为传入的数组的名字; 使用dynamic标签避免数组为空时导致sql语句语法出错; 使用isNotNull标签避免数组为null时ibatis解析出错 。
5.传递参数只含有一个数组 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<select id=
"com.fashionfree.stat.accesslog.model.StatMemberAction.selectActionIdsOfModule"
resultClass=
"hashMap"
>
select
moduleId, actionId
from
StatMemberAction
<dynamic prepend=
"where moduleId in"
>
<iterate open=
"("
close=
")"
conjunction=
","
>
#[]#
</iterate>
</dynamic>
order by
moduleId
</select>
<select id=
"com.fashionfree.stat.accesslog.model.StatMemberAction.selectActionIdsOfModule"
resultClass=
"hashMap"
>
select
moduleId, actionId
from
StatMemberAction
<dynamic prepend=
"where moduleId in"
>
<iterate open=
"("
close=
")"
conjunction=
","
>
#[]#
</iterate>
</dynamic>
order by
moduleId
</select>
|
说明:注意select的标签中没有parameterClass一项 。
另:这里也可以把数组放进一个hashMap中,但增加额外开销,不建议使用 。
6.让ibatis把参数直接解析成字符串 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<select id=
"com.fashionfree.stat.accesslog.selectSumDistinctCountOfAccessMemberNum"
parameterClass=
"hashMap"
resultClass=
"int"
>
select
count(distinct memberId)
from
MemberAccessLog
where
accessTimestamp >= #start#
and accessTimestamp < #end#
and actionId in $actionIdString$
</select>
<select id=
"com.fashionfree.stat.accesslog.selectSumDistinctCountOfAccessMemberNum"
parameterClass=
"hashMap"
resultClass=
"int"
>
select
count(distinct memberId)
from
MemberAccessLog
where
accessTimestamp >= #start#
and accessTimestamp < #end#
and actionId in $actionIdString$
</select>
|
说明:使用这种方法存在sql注入的风险,不推荐使用 。
7.分页查询 (pagedQuery) 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
<select id=
"com.fashionfree.stat.accesslog.selectMemberAccessLogBy"
parameterClass=
"hashMap"
resultMap=
"MemberAccessLogMap"
>
<include refid=
"selectAllSql"
/>
<include refid=
"whereSql"
/>
<include refid=
"pageSql"
/>
</select>
<select id=
"com.fashionfree.stat.accesslog.selectMemberAccessLogBy.Count"
parameterClass=
"hashMap"
resultClass=
"int"
>
<include refid=
"countSql"
/>
<include refid=
"whereSql"
/>
</select>
<sql id=
"selectAllSql"
>
select
accessLogId, memberId, clientIP,
httpMethod, actionId, requestURL,
accessTimestamp, extend1, extend2,
extend3
from
MemberAccessLog
</sql>
<sql id=
"whereSql"
>
accessTimestamp <= #accessTimestamp#
</sql>
<sql id=
"countSql"
>
select
count(*)
from
MemberAccessLog
</sql>
<sql id=
"pageSql"
>
<dynamic>
<isNotNull property=
"startIndex"
>
<isNotNull property=
"pageSize"
>
limit #startIndex# , #pageSize#
</isNotNull>
</isNotNull>
</dynamic>
</sql>
<select id=
"com.fashionfree.stat.accesslog.selectMemberAccessLogBy"
parameterClass=
"hashMap"
resultMap=
"MemberAccessLogMap"
>
<include refid=
"selectAllSql"
/>
<include refid=
"whereSql"
/>
<include refid=
"pageSql"
/>
</select>
<select id=
"com.fashionfree.stat.accesslog.selectMemberAccessLogBy.Count"
parameterClass=
"hashMap"
resultClass=
"int"
>
<include refid=
"countSql"
/>
<include refid=
"whereSql"
/>
</select>
<sql id=
"selectAllSql"
>
select
accessLogId, memberId, clientIP,
httpMethod, actionId, requestURL,
accessTimestamp, extend1, extend2,
extend3
from
MemberAccessLog
</sql>
<sql id=
"whereSql"
>
accessTimestamp <= #accessTimestamp#
</sql>
<sql id=
"countSql"
>
select
count(*)
from
MemberAccessLog
</sql>
<sql id=
"pageSql"
>
<dynamic>
<isNotNull property=
"startIndex"
>
<isNotNull property=
"pageSize"
>
limit #startIndex# , #pageSize#
</isNotNull>
</isNotNull>
</dynamic>
</sql>
|
说明:本例中,代码应为:
1
2
3
|
HashMap hashMap =
new
HashMap();
hashMap.put(“accessTimestamp”, someValue);
pagedQuery(“com.fashionfree.stat.accesslog.selectMemberAccessLogBy”, hashMap);
|
pagedQuery方法首先去查找名为com.fashionfree.stat.accesslog.selectMemberAccessLogBy.Count 的mapped statement来进行sql查询,从而得到com.fashionfree.stat.accesslog.selectMemberAccessLogBy查询的记录个数, 再进行所需的paged sql查询(com.fashionfree.stat.accesslog.selectMemberAccessLogBy),具体过程参见utils类中的相关代码 。
8.sql语句中含有大于号>、小于号< 1. 将大于号、小于号写为: > < 如:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
<delete id=
"com.fashionfree.stat.accesslog.deleteMemberAccessLogsBefore"
parameterClass=
"long"
>
delete from
MemberAccessLog
where
accessTimestamp <= #value#
</delete>
Xml代码
<delete id=
"com.fashionfree.stat.accesslog.deleteMemberAccessLogsBefore"
parameterClass=
"long"
>
delete from
MemberAccessLog
where
accessTimestamp <= #value#
</delete>
|
将特殊字符放在xml的CDATA区内:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<delete id=
"com.fashionfree.stat.accesslog.deleteMemberAccessLogsBefore"
parameterClass=
"long"
>
<![CDATA[
delete from
MemberAccessLog
where
accessTimestamp <= #value#
]]>
</delete>
<delete id=
"com.fashionfree.stat.accesslog.deleteMemberAccessLogsBefore"
parameterClass=
"long"
>
<![CDATA[
delete from
MemberAccessLog
where
accessTimestamp <= #value#
]]>
</delete>
|
推荐使用第一种方式,写为< 和 > (XML不对CDATA里的内容进行解析,因此如果CDATA中含有dynamic标签,将不起作用) 。
9.include和sql标签 将常用的sql语句整理在一起,便于共用:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<sql id=
"selectBasicSql"
>
select
samplingTimestamp,onlineNum,year,
month,week,day,hour
from
OnlineMemberNum
</sql>
<sql id=
"whereSqlBefore"
>
where samplingTimestamp <= #samplingTimestamp#
</sql>
<select id=
"com.fashionfree.accesslog.selectOnlineMemberNumsBeforeSamplingTimestamp"
parameterClass=
"hashmap"
resultClass=
"OnlineMemberNum"
>
<include refid=
"selectBasicSql"
/>
<include refid=
"whereSqlBefore"
/>
</select>
<sql id=
"selectBasicSql"
>
select
samplingTimestamp,onlineNum,year,
month,week,day,hour
from
OnlineMemberNum
</sql>
<sql id=
"whereSqlBefore"
>
where samplingTimestamp <= #samplingTimestamp#
</sql>
<select id=
"com.fashionfree.accesslog.selectOnlineMemberNumsBeforeSamplingTimestamp"
parameterClass=
"hashmap"
resultClass=
"OnlineMemberNum"
>
<include refid=
"selectBasicSql"
/>
<include refid=
"whereSqlBefore"
/>
</select>
|
注意:sql标签只能用于被引用,不能当作mapped statement。如上例中有名为selectBasicSql的sql元素,试图使用其作为sql语句执行是错误的
1
|
sqlMapClient.queryForList(“selectBasicSql”); ×
|
10.随机选取记录 。
1
2
3
|
<sql id=”randomSql”>
ORDER BY rand() LIMIT #number#
</sql>
|
从数据库中随机选取number条记录(只适用于MySQL) 。
11.将SQL GROUP BY分组中的字段拼接 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<sql id=”selectGroupBy>
SELECT
a.answererCategoryId, a.answererId, a.answererName,
a.questionCategoryId, a.score, a.answeredNum,
a.correctNum, a.answerSeconds, a.createdTimestamp,
a.lastQuestionApprovedTimestamp, a.lastModified, GROUP_CONCAT(q.categoryName) as categoryName
FROM
AnswererCategory a, QuestionCategory q
WHERE a.questionCategoryId = q.questionCategoryId
GROUP BY a.answererId
ORDER BY a.answererCategoryId
</sql>
<sql id=”selectGroupBy>
SELECT
a.answererCategoryId, a.answererId, a.answererName,
a.questionCategoryId, a.score, a.answeredNum,
a.correctNum, a.answerSeconds, a.createdTimestamp,
a.lastQuestionApprovedTimestamp, a.lastModified, GROUP_CONCAT(q.categoryName) as categoryName
FROM
AnswererCategory a, QuestionCategory q
WHERE a.questionCategoryId = q.questionCategoryId
GROUP BY a.answererId
ORDER BY a.answererCategoryId
</sql>
|
注:SQL中使用了MySQL的GROUP_CONCAT函数 。
12.按照IN里面的顺序进行排序 。
①MySQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<sql id=”groupByInArea”>
select
moduleId, moduleName,
status, lastModifierId, lastModifiedName,
lastModified
from
StatModule
where
moduleId in (
3
,
5
,
1
)
order by
instr(
',3,5,1,'
,
','
+ltrim(moduleId)+
','
)
</sql>
<sql id=”groupByInArea”>
select
moduleId, moduleName,
status, lastModifierId, lastModifiedName,
lastModified
from
StatModule
where
moduleId in (
3
,
5
,
1
)
order by
instr(
',3,5,1,'
,
','
+ltrim(moduleId)+
','
)
</sql>
|
②SQLSERVER
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<sql id=”groupByInArea”>
select
moduleId, moduleName,
status, lastModifierId, lastModifiedName,
lastModified
from
StatModule
where
moduleId in (
3
,
5
,
1
)
order by
charindex(
','
+ltrim(moduleId)+
','
,
',3,5,1,'
)
</sql>
<sql id=”groupByInArea”>
select
moduleId, moduleName,
status, lastModifierId, lastModifiedName,
lastModified
from
StatModule
where
moduleId in (
3
,
5
,
1
)
order by
charindex(
','
+ltrim(moduleId)+
','
,
',3,5,1,'
)
</sql>
|
说明:查询结果将按照moduleId在in列表中的顺序(3, 5, 1)来返回 。
1
|
MySQL : instr(str, substr)
|
SQLSERVER: charindex(substr, str) 返回字符串str 中子字符串的第一个出现位置 ltrim(str) 返回字符串str, 其引导(左面的)空格字符被删除 。
13.resultMap resultMap负责将SQL查询结果集的列值映射成Java Bean的属性值 。
1
2
3
4
5
6
7
8
9
|
<resultMap
class
=
"java.util.HashMap"
id=
"getActionIdAndActionNumber"
>
<result column=
"actionId"
property=
"actionId"
jdbcType=
"BIGINT"
javaType=
"long"
/>
<result column=
"count"
property=
"count"
jdbcType=
"INT"
javaType=
"int"
/>
</resultMap>
Xml代码
<resultMap
class
=
"java.util.HashMap"
id=
"getActionIdAndActionNumber"
>
<result column=
"actionId"
property=
"actionId"
jdbcType=
"BIGINT"
javaType=
"long"
/>
<result column=
"count"
property=
"count"
jdbcType=
"INT"
javaType=
"int"
/>
</resultMap>
|
使用resultMap称为显式结果映射,与之对应的是resultClass(内联结果映射),使用resultClass的最大好处便是简单、方便,不需显示指定结果,由iBATIS根据反射来确定自行决定。而resultMap则可以通过指定jdbcType和javaType,提供更严格的配置认证.
14.typeAlias 。
1
2
|
<typeAlias alias=
"MemberOnlineDuration"
type=
"com.fashionfree.stat.accesslog.model.MemberOnlineDuration"
/>
<typeAlias>
|
允许你定义别名,避免重复输入过长的名字 。
15.remap 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<select id=
"testForRemap"
parameterClass=
"hashMap"
resultClass=
"hashMap"
remapResults=
"true"
>
select
userId
<isEqual property=
"tag"
compareValue=
"1"
>
, userName
</isEqual>
<isEqual property=
"tag"
compareValue=
"2"
>
, userPassword
</isEqual>
from
UserInfo
</select>
<select id=
"testForRemap"
parameterClass=
"hashMap"
resultClass=
"hashMap"
remapResults=
"true"
>
select
userId
<isEqual property=
"tag"
compareValue=
"1"
>
, userName
</isEqual>
<isEqual property=
"tag"
compareValue=
"2"
>
, userPassword
</isEqual>
from
UserInfo
</select>
|
此例中,根据参数tag值的不同,会获得不同的结果集,如果没有remapResults="true"属性,iBatis会将第一次查询时的结果集缓存,下次再执行时(必须还是该进程中)不会再执行结果集映射,而是会使用缓存的结果集.
因此,如果上面的例子中remapResult为默认的false属性,而有一段程序这样书写:
1
2
3
4
5
|
HashMap<String, Integer> hashMap =
new
HashMap<String, Integer>();
hashMap.put(
"tag"
,
1
);
sqlClient.queryForList(
"testForRemap"
, hashMap);
hashMap.put(
"tag"
,
2
);
sqlClient.queryForList(
"testForRemap"
, hashMap);
|
Java代码 。
1
2
3
4
5
|
HashMap<String, Integer> hashMap =
new
HashMap<String, Integer>();
hashMap.put(
"tag"
,
1
);
sqlClient.queryForList(
"testForRemap"
, hashMap);
hashMap.put(
"tag"
,
2
);
sqlClient.queryForList(
"testForRemap"
, hashMap);
|
则程序会在执行最后一句的query查询时报错,原因就是iBATIS使用了第一次查询时的结果集,而前后两次的结果集是不同的:(userId, userName)和(userId, userPassword),所以导致出错。如果使用了remapResults="true"这一属性,iBATIS会在每次执行查询时都执行结果集映射,从而避免错误的发生(此时会有较大的开销).
16.dynamic标签的prepend dynamic标签的prepend属性作为前缀添加到结果内容前面,当标签的结果内容为空时,prepend属性将不起作用.
当dynamic标签中存在prepend属性时,将会把其嵌套子标签的第一个prepend属性忽略。例如:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<sql id=
"whereSql"
>
<
dynamic
prepend=
"where "
>
<isNotNull property=
"userId"
prepend=
"BOGUS"
>
userId = #userId#
</isNotNull>
<isNotEmpty property=
"userName"
prepend=
"and "
>
userName = #userName#
</isNotEmpty>
</
dynamic
>
</sql>
<sql id=
"whereSql"
>
<
dynamic
prepend=
"where "
>
<isNotNull property=
"userId"
prepend=
"BOGUS"
>
userId = #userId#
</isNotNull>
<isNotEmpty property=
"userName"
prepend=
"and "
>
userName = #userName#
</isNotEmpty>
</
dynamic
>
</sql>
|
此例中,dynamic标签中含有两个子标签<isNotNull>和<isNotEmpty>。根据前面叙述的原则,如果<isNotNull>标签中没有prepend="BOGUS" 这一假的属性来让dynamic去掉的话,<isNotEmpty>标签中的and就会被忽略,会造成sql语法错误.
注意:当dynamic标签没有prepend属性时,不会自动忽略其子标签的第一个prepend属性.
以上所述是小编给大家介绍的iBatis习惯用的16条SQL语句,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对我网站的支持! 。
原文链接:http://www.cnblogs.com/huiy/archive/2016/10/26/6000676.html 。
最后此篇关于iBatis习惯用的16条SQL语句的文章就讲到这里了,如果你想了解更多关于iBatis习惯用的16条SQL语句的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。
创建一个“海盗对话”,可以选择左手或右手。我希望它对“左”和“右”的不同拼写做出积极的回答(正如您将在代码中看到的那样),但是,当我为所有非“右”或“左”的输入添加最终的“else”代码时,它给了我一
With 语句 对一个对象执行一系列的语句。 With object statements End With 参数 object 必需的部分
While...Wend 语句 当指定的条件为 True 时,执行一系列的语句。 While condition  ; Version [stat
所以我正在处理的代码有一个小问题。 while True: r = input("Line: ") n = r.split() if r == " ":
我有一个对象数组: var contacts = [ { "firstName": "Akira", "lastName": "Laine", "number"
int main() { int f=fun(); ... } int fun() { return 1; return 2; } 在上面的程序中,当从main函数中调用一个
我的项目中有很多 if 语句、嵌套 if 语句和 if-else 语句,我正在考虑将它们更改为 switch 语句。其中一些将具有嵌套的 switch 语句。我知道就编译而言,switch 语句通常更
Rem 语句 包含程序中的解释性注释。 Rem comment 或 ' comment comment 参数是需要包含的注释文本。在 Rem 关键字和 comment 之间应有一个空格。
ReDim 语句 在过程级中声明动态数组变量并分配或重新分配存储空间。 ReDim [Preserve] varname(subscripts) [, varname(subscripts)]
Randomize 语句 初始化随机数生成器。 Randomize [number] number 参数可以是任何有效的数值表达式。 说明 Randomize 使用 number 参数初始
Public 语句 定义公有变量并分配存储空间。在 Class 块中定义私有变量。 Public varname[([subscripts])][, varname[([subscripts])
Sub 语句 声明 Sub 过程的名称、参数以及构成其主体的代码。 [Public [Default]| Private] Sub name [( arglist )]
Set 语句 将对象引用赋给一个variable或property,或者将对象引用与事件关联。 Set objectvar = {objectexpression | New classname
我有这个代码块,有时第一个 if 语句先运行,有时第二个 if 语句先运行。我不确定为什么会这样,因为我认为 javascript 是同步的。 for (let i = 0; i < dataObje
这是一个 javascript 代码,我想把它写成这样:如果此人回答是,则回复“那很酷”,如果此人回答否,则回复“我会让你开心”,如果此人回答的问题包含"is"或“否”,请说“仅键入”是或否,没有任何
这是我的任务,我尝试仅使用简短的 if 语句来完成此任务,我得到的唯一错误是使用“(0.5<=ratio<2 )”,除此之外,构造正确吗? Scanner scn = new Scanner(
有没有办法在 select 语句中使用 if 语句? 我不能在这个中使用 Case 语句。实际上我正在使用 iReport 并且我有一个参数。我想要做的是,如果用户没有输入某个参数,它将选择所有实例。
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: If vs. Switch Speed 我将以 C++ 为例,但我要问的问题不是针对特定语言的。我的意思是一
Property Set 语句 在 Class 块中,声明名称、参数和代码,这些构成了将引用设置到对象的 Property 过程的主体。 [Public | Private] Pro
Property Let 语句 在 Class 块中,声明名称、参数和代码等,它们构成了赋值(设置)的 Property 过程的主体。 [Public | Private] Prop
我是一名优秀的程序员,十分优秀!