Sha256: 024a3f04bb0955dd3094c80166f6a21eeb46f943af1b38309d823e6893d70afc

Contents?: true

Size: 808 Bytes

Versions: 7

Compression:

Stored size: 808 Bytes

Contents

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

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

7 entries across 7 versions & 1 rubygems

Version Path
vraptor-scaffold-1.1.0 lib/vraptor-scaffold/generators/app_generator/templates/src/models/Entity.java.tt
vraptor-scaffold-1.1.0.pre lib/vraptor-scaffold/generators/app_generator/templates/src/models/Entity.java.tt
vraptor-scaffold-1.0.0 lib/generators/app_generator/templates/src/models/Entity.java.tt
vraptor-scaffold-0.0.4 lib/generators/app_generator/templates/src/models/Entity.java.tt
vraptor-scaffold-0.0.3 lib/generators/app_generator/templates/src/models/Entity.java.tt
vraptor-scaffold-0.0.2 lib/generators/app_generator/templates/src/models/Entity.java.tt
vraptor-scaffold-0.0.1 lib/generators/app_generator/templates/src/models/Entity.java.tt