All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codegas.commons.domain.entity.NamedEntity Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package org.codegas.commons.domain.entity;

import org.codegas.commons.lang.value.Id;

import javax.persistence.Basic;
import javax.persistence.MappedSuperclass;

@MappedSuperclass
public abstract class NamedEntity extends DomainEntity {

    @Basic(optional = false)
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        if (name == null || (name = name.trim()).isEmpty()) {
            throw new IllegalArgumentException("Entity name must not be null/empty: " + name);
        }
        this.name = name;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy