English 中文(简体)
重新审定作为非行制约因素
原标题:Reuse validation as DB constraints

我用“游戏! 框架和在撰写测试时发现,我可以挽救一个无效的模型,例如,在某些情况下具有无效价值变量。 我猜测,人们期望的行为会保持正确性和持久性。 但是,将审定说明作为数据库制约因素是否有任何办法?

最佳回答

我对“游戏”没有任何了解。 您是否使用JSR 303的验证说明? http://www.playframework.org/documentation/1.2.2/model#hibernate”rel=“nofollow” 游乐文件,它能够/多出使用Hibernate for persistent。 如Hibernate 3.5, expressed through JSR 303 note in the schema.

问题回答

无,验证与数据库制约因素没有关联。 你们必须用人工方式在数据库中增加制约因素,例如利用新的evolutions,“游戏1.2.1框架”。

在你的单位测试中,你必须确保数据正确。 不管怎样,你只应在《示范法》中测试逻辑,不同类别之间都不存在依赖性,只是做了一些测试,以核实在哪些地方可以使用意外参数,而不会对以错误数据节省的事例感到担忧。

在您的融合测试和 se测中,你应当能够利用“游戏”通过“Valid”在控制器电话上提供的验证系统。 这里,你应确保不会有数据不准确的物体,试图添加一些物体。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签