witam nigdy nie pisałem aplikacji z zapisem do bazy, to jest pierwszy raz Powiedzcie mi co mam zle z metodami get...
package studenci;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
public class Studenci implements Serializable
{
private static final long serialVersionUID = 1L;
//--------------------------------------------------------------------------
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID")
private Long id;
public Long getId() {return id; }
public void setId(Long id) { this.id = id; }
//--------------------------------------------------------------------------
@Column(name = "IMIE")
private String name;
<b>public void getName(){return name;}</b>
public void setName(String name){this.name=name;}
//--------------------------------------------------------------------------
@Column(name = "NAZWISKO")
private String surname;
<b> public void getNazwisko(){return surname;}</b>
public void setNazwisko(String surname){this.surname=surname;}
//--------------------------------------------------------------------------
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
if (!(object instanceof Studenci)) {
return false;
}
Studenci other = (Studenci) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "studenci.Studenci[id=" + id + "]";
}
}
komunikat to "nie mozna zwrocic wartosci z metody wktorej typem zwracanym jest void. Nie rozumiem tego moze mi ktos wytlumaczyc?