Добавил новый класс-домен, с описанием таблиц, полей и т.д. Когда добавляю нужную запись в hibernate.cfg.xml, то получаю Unable to load class declared as <mapping class="net.schastny.contactmanager.domain.news.News"/> in the configuration: Класс выглядит так:
| Код | package net.schastny.contactmanager.domain.news; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; @Entity @Table(name = "NEWS") public class News { @Id @Column(name = "ID") @GeneratedValue private Integer id; @Column(name = "TITLE") private String title; @Column(name = "CONTENT") private String content; @Temporal(TemporalType.TIMESTAMP ) @Column(name = "PUBLISH_TIME" ,columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP") private java.util.Date publish_time; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public java.util.Date getPublish_time() { return publish_time; } public void setPublish_time(java.util.Date publish_time) { this.publish_time = publish_time; } } |
Делал по примеру http://habrahabr.ru/post/111102/ |