vkantiya vkantiya - 1 year ago 80
Scala Question

How do we create Unique Constraint in lift-mapper

How can we create a unique constraint in lift's mapper ?

Answer Source

You can do that by adding the following in your MetaMapper object

override def dbIndexes=UniqueIndex(<name-of-the-field>)::super.dbIndexes

comma separated list of fields can also be provided

for example - UniqueIndex(name,dob)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download