Home  >  Article  >  Database  >  PowerDesigner数据库建模name和code写反了解决或者是设置name和c

PowerDesigner数据库建模name和code写反了解决或者是设置name和c

WBOY
WBOYOriginal
2016-06-07 15:35:501759browse

这个功能虽然好用,但是我需要在Name这一项加上一个中文的注释,这个时候怎么办呢? 下面两个例子,相信对你相当有用. Examples · Script 1: .set_value(_First, true, new) .foreach_part(%Name%, '#') .if (%_First%) .delete(%CurrentPart%) .set_value(_Fir

这个功能虽然好用,但是我需要在Name这一项加上一个中文的注释,这个时候怎么办呢?
下面两个例子,相信对你相当有用.
Examples

· Script 1: 
.set_value(_First, true, new) 
.foreach_part(%Name%, "'#'") 
.if (%_First%) 
.delete(%CurrentPart%) 
.set_value(_First, false, update) 
.else 
%CurrentPart% 
.endif 
.next

这个例子是把Name内容的#号后边的内容当作Code.
如:在Name列输入    用户名#user_name  则在Code列自动会变成   user_name

· Script 2: 
.set_value(_First, true, new) 
.foreach_part(%Name%, "'#'") 
.if (%_First%) 
%CurrentPart% 
.set_value(_First, false, update) 
.endif 
.next

这个例子是把Name内容的#号前边的内容当作Code.
如:在Name列输入    user_name#用户名  则在Code列自动会变成   user_name

具体操作方法是:
1、打开powerDesigner菜单的Tools->Model Options....->Naming Convention
2、选中Name,并勾选Enable name/code conversions.
3、选择Name To Code,把上面任意一个例子的代码(红色部分)贴到conversion script内容框中即可。

注:用这个script的时候,必须先设置,才会转换的。
如果你已经设计好了,再设置是不会对之前的东西改变的。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn