org.springframework.dao.DataIntegrityViolationException: could not insert: [us.jyg.freshet.dao.model.Album]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [us.jyg.freshet.dao.model.Album] Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [us.jyg.freshet.dao.model.Album] ..... at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:676) at us.jyg.freshet.dao.util.SongFactory.doHibernate(SongFactory.java:56) SongData songData = new SongData(f); Album album = new Album(songData.getAlbum()); Artist artist = new Artist(songData.getArtist()); Genre genre = new Genre(songData.getGenre()); Song song = new Song( songData.getName(), songData.getPath(), songData.getTrack(), album, artist, genre); ht.saveOrUpdate(song);