blob: f7bc91d37c8355cf58365c7277af524852922d32 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
*/
import javax.persistence.PreUpdate
import ns org.eclipse.osbp.authentication.account.datatypes.BlobImage
import ns org.eclipse.osbp.authentication.account.datatypes.String
import ns org.eclipse.osbp.authentication.account.datatypes.boolean
import ns org.eclipse.osbp.authentication.account.datatypes.int
import ns org.eclipse.osbp.authentication.account.datatypes.Boolean
package org.eclipse.osbp.authentication.account.entities {
entity UserAccount {
persistenceUnit "authentication"
uuid String id
var String email
var String[1] userName
var String password
var String [ regex("[0-9]*") ] extraPassword
var boolean passwordReset
var String position properties(key = "organization" value = "")
var String defaultPerspective properties(key = "perspective" value = "")
var boolean enabled
var boolean locked
var boolean superuser
var boolean supervisor
var boolean forcePwdChange
var boolean notRegistered
var int failedAttempt
var int successfulAttempt
var int cookieHashCode
var String localeTag
var BlobImage profileimage
var String layoutingStrategy
var String focusingStrategy
var String theme properties(key = "theme" value = "")
var String printService properties(key = "printservice" value = "")
ref UserAccountFilter [*] userAccountFilter opposite userAccount
@PreUpdate
def void preUpdate() {
if ( locked && ! enabled )
{
locked = false
failedAttempt = 00
}
}
unique index indexUserName {
userName
}
}
entity UserAccountFilter {
persistenceUnit "authentication"
uuid String id
var String ^filter
var boolean invers
ref UserAccount userAccount opposite userAccountFilter
}
}