on 2015 May 28 1:57 PM
I have a model and storing email to that. but how would I stop allowing duplicate entry on model. even in items.xml i have made it as unique.
items.xml:
<persistence type="property" />
<modifiers unique="true" optional="false" initial="true" />
ex: final NewsLetterEmailModel emailModel = new NewsLetterEmailModel(); emailModel.setEmail(email); modelservice.save(emailmodel)
regards, Mohiddin
Request clarification before answering.
Before saving a new NewsLetterEmailModel you should query your database if an entry with the same email value already exists.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.