数据模型类表示实际的消息数据。
它们只是扩展了基本模型类。
我采用POJT对域模型类的业务方法进行测试。
I tested the business methods of domain model classes with POJTs.
接下来是模型类。
清单1给出了一个服务接口和根数据模型类的简单例子。
Listing 1 gives a simple example of a service interface, and a root data model class.
关联涉及多个模型类,它带有表示用于参数的值的属性。
A relation involves several model classes, which have properties that represent the values that will be applied to these parameters.
在很多应用中,一个控制器可能同时与多个模型类进行交互。
All but the most trivial applications will find that controllers sometimes interact with more than one model class.
模型类存放实际的业务逻辑,并管理与应用程序部分对应的数据。
The model class holds the essential business logic and manages the data corresponding to that part of the application.
由于迁移早已包含了列,为什么还要在模型类中再次将它们列出来呢?
Because the migration already contains the columns, why should you list them again in the model class?
现在,只需要两行代码就可以让模型类合理完成我期望它完成的事情。
Now, this is a reasonable amount of what we want a model class to do, all in two lines of code.
既然请求已经通过了所有检查和障碍,它就可以交给模型类来处理了。
Now that the request has cleared all the checks and hurdles, it's ready to be handed off to the model class for processing.
这是放置模型类的地方,其中已经有一个模型类:User。
This is where we put model classes in Lift, and there is already one there: User.
如果表格的名字与命名规则是一致的,那你就不用定义模型类来映射了。
If your table name is compatible with the naming conventions, then you don't even need to define a model class to map it to.
如果找到了一个匹配的表格,DrySQL会自动为它生成一个模型类。
If a matching table is found, DrySQL will automatically generate a model class for it.
要设计TableViewer演示应用程序,您必须创建数据模型类。
To design a TableViewer demo application, you must create a data model class.
DrySQL会提取表格中的约束定义,并用它们自动生成模型类的关联。
DrySQL retrieves your table's constraint definitions, and USES them to automatically generate associations for your model class.
生成的数据模型类对于客户机和服务器都是相同的,即使是由项目构建单独创建的。
The generated data model classes are the same for client and server, even though they're generated separately by the project build.
由JAXB实现负责从数据模型类访问注释信息并在执行xml转换时应用这些注释。
It's up to the JAXB implementation to access the annotation information from the data model classes and apply these annotations when converting to and from XML.
通常你会在每个模型类中找到至少一个关联,从联系顶级模型类的关联开始。
You will usually find at least one relation per model class, starting from a relation that relates the top-level model classes.
下面的代码显示了ActiveRecord向应用程序和对应模型类上迁移的过程。
The code below shows the ActiveRecord migrations for the application and the corresponding model classes.
首先,要求Streamlined生成应用程序模板和所指定的每个模型类的元数据的占位器。
First, you ask Streamlined to generate an application template and a holder for the metadata for each model class you specify.
因为包含事务逻辑的惟一的一个层是api层,我将只展示该层的域模型类中的事务逻辑。
Because the only layer containing transaction logic is the API layer, I will only show the transaction logic in that layer's domain-model classes.
在MTF中的一个关系(也称为一个映射规则)定义了一种可应用于给定模型类的实例的映射类型。
A relation in MTF (also referred to as a mapping rule) defines a type of mapping that will apply to instances of given model classes.
在Scala 中,方括号表示参数化的类;在这里,参数是ID的类型和实际模型类的类型。
The square brackets denote a parameterized class in Scala, and in this case, it takes the type of the ID and the type of the actual model class.
可以将一个模型类绑定到一个XWTUI,而同时,模型对象中的数据字段会被自动地提供给UI控件。
You can bind a model class to an XWT UI while, at the same time, the data field in the model object will be automatically fed to the UI controls.
Swing组件作为用户交互的目标,在用户与它们交互的时候触发事件;数据模型类在数据发生变化时触发事件。
Swing components that are the targets of user interaction fire events when the user interacts with them; data model classes fire events when the data has changed.
这意味着创建模型类和服务,并在启动阶段向它们提供配置信息,如果配置改变的话,还将在后面的阶段提供配置信息。
This means creating the model class and services, and feeding them configuration information at startup, and later if there are configuration changes.
惟一需要当心的是枚举类型。 它被定义成一个Class,而不是其他模型类中的Interface!
The only other thing to watch out for is that an enumerated type is defined using a Class and not an Interface like other model classes.
模型表示数据库中存储的数据,每个表在Ruby 中都有一个对应的ActiveRecord 模型类。
The model represents the data stored in the database with each table having a corresponding ActiveRecord model class in Ruby.
为了满足我们的需要,我们必须对其进行调整和定制。 我们可以改变所生成的模型类的实现,也可以对编辑器进行扩展和定制。
To fit our requirements, we must make adjustments and customizations, from changing the implementation of the generated model classes to extending and customizing the editors.
应用推荐