blob: 56e7c5d46e029ca4e04628fdac14dcb3792ee63a [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 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*/
import javax.persistence.Cacheable
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.blobtype
import ns org.eclipse.osbp.authentication.account.datatypes.boolean
import ns org.eclipse.osbp.authentication.account.datatypes.int
package org.eclipse.osbp.authentication.account.entities {
@Cacheable(false) // disable caching for userdata to allow manipulation of user data via SQL tools
entity UserAccount {
persistenceUnit "authentication"
uuid String id
var unique String[1] email
var unique String[1] userName
var hidden 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 forcePwdChange
var boolean notRegistered
var int failedAttempt
var int successfulAttempt
var hidden int cookieHashCode
var String localeTag properties(key = "i18n" value = "")
var BlobImage profileimage
var String layoutingStrategy
var String focusingStrategy
var String theme properties(key = "theme" value = "")
var String printService properties(key = "printservice" value = "")
var hidden blobtype savedProperties
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
}
}