Sha256: 27a82acb747bc96b46d22f5a99365a96ba0d31610e34d57e0caf092aa19e58e3

Contents?: true

Size: 833 Bytes

Versions: 5

Compression:

Stored size: 833 Bytes

Contents

package <%= options[:package] %>.<%= options[:models_package] %>;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

@MappedSuperclass
public class Entity {
	
	@Id @GeneratedValue
	private Long id;
	
	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (this == obj) {
			return true;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		final Entity other = (Entity) obj;
		if (id != other.id && (id == null || !id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public int hashCode() {
		int hash = 7;
		hash = 17 * hash + (this.getId() != null ? this.getId().hashCode() : 0);
		return hash;
	}
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vraptor-scaffold-1.3.0 lib/vraptor-scaffold/generators/app/templates/models/Entity.erb
vraptor-scaffold-1.3.0.rc lib/vraptor-scaffold/generators/app/templates/models/Entity.erb
vraptor-scaffold-1.2.3 lib/vraptor-scaffold/generators/app/templates/models/Entity.erb
vraptor-scaffold-1.2.1 lib/vraptor-scaffold/generators/app/templates/models/Entity.erb
vraptor-scaffold-1.2.0 lib/vraptor-scaffold/generators/app/templates/models/Entity.erb