| /** |
| * Copyright (C) - Loetz GmbH&Co.KG, 69115 Heidelberg, Germany |
| * |
| * This source was created by OSBP Softwarefactory Wizard! |
| * |
| * OSBP is (C) - Loetz GmbH&Co.KG, 69115 Heidelberg, Germany |
| * |
| * ================================================================ |
| * |
| * @file $HeadURL$ |
| * @version $Revision$ |
| * @date $Date$ |
| * @author $Author$ |
| */ |
| package org.osbp.mysmartshop.entities; |
| |
| import javax.persistence.Column; |
| import javax.persistence.Entity; |
| import javax.persistence.PreRemove; |
| import javax.persistence.Table; |
| import org.eclipse.osbp.dsl.common.datatypes.IEntity; |
| import org.eclipse.osbp.runtime.common.annotations.Dispose; |
| import org.eclipse.osbp.runtime.common.annotations.DomainKey; |
| import org.osbp.mysmartshop.entities.BaseUUID; |
| |
| /** |
| * relation of the company to the owner - not the user - of this personal information manager |
| */ |
| @Entity |
| @Table(name = "COMPANY_RELATION_TYPE") |
| @SuppressWarnings("all") |
| public class CompanyRelationType extends BaseUUID implements IEntity { |
| /** |
| * short name for this relation type |
| */ |
| @DomainKey |
| @Column(name = "NAME") |
| private String name; |
| |
| /** |
| * more detailed description |
| */ |
| @Column(name = "DESCRIPTION") |
| private String description; |
| |
| /** |
| * Checks whether the object is disposed. |
| * @throws RuntimeException if the object is disposed. |
| */ |
| private void checkDisposed() { |
| if (isDisposed()) { |
| throw new RuntimeException("Object already disposed: " + this); |
| } |
| } |
| |
| /** |
| * Calling dispose will destroy that instance. The internal state will be |
| * set to 'disposed' and methods of that object must not be used anymore. |
| * Each call will result in runtime exceptions.<br> |
| * If this object keeps composition containments, these will be disposed too. |
| * So the whole composition containment tree will be disposed on calling this method. |
| */ |
| @Dispose |
| public void dispose() { |
| if (isDisposed()) { |
| return; |
| } |
| super.dispose(); |
| } |
| |
| /** |
| * @return Returns the name property or <code>null</code> if not present. |
| */ |
| public String getName() { |
| checkDisposed(); |
| return this.name; |
| } |
| |
| /** |
| * Sets the name property to this instance. |
| */ |
| public void setName(final String name) { |
| checkDisposed(); |
| this.name = name; |
| } |
| |
| /** |
| * @return Returns the description property or <code>null</code> if not present. |
| */ |
| public String getDescription() { |
| checkDisposed(); |
| return this.description; |
| } |
| |
| /** |
| * Sets the description property to this instance. |
| */ |
| public void setDescription(final String description) { |
| checkDisposed(); |
| this.description = description; |
| } |
| |
| /** |
| * Iterates all cross references and removes them from the parent to avoid ConstraintViolationException |
| */ |
| @PreRemove |
| protected void preRemove() { |
| |
| } |
| } |