If someone can take a moment to look at the compile error shown below, I would greatly appreciate it. I had just purchased a book, Hibernate : A Developer's Notebook (by Jim Elliott), and am going through the examples. I ran into a small issue when I try to run the "ant ctest" target. This target essentially compiles and executes the class CreateTest. The class is suppose to insert three records into the Track table. The Track.java and CreateTest.java class snippet codes in questions have been pasted below as well. Thanks.
Error
[javac] Compiling 1 source file to C:\hibernate\hworkspace\classes
[javac] C:\hibernate\hworkspace\src\com\oreilly\hh\CreateTest.java:33: cannot resolve symbol
[javac] symbol : constructor Track (java.lang.String,java.lang.String,java.sql.Time,java.util.Date,short)
[javac] location: class com.oreilly.hh.Track
[javac] Track track = new Track("Russian Trance",
[javac] ^
[javac] C:\hibernate\hworkspace\src\com\oreilly\hh\CreateTest.java:39: cannot resolve symbol
[javac] symbol : constructor Track (java.lang.String,java.lang.String,java.sql.Time,java.util.Date,short)
[javac] location: class com.oreilly.hh.Track
[javac] track = new Track("Video Killed the Radio Star",
[javac] ^
[javac] C:\hibernate\hworkspace\src\com\oreilly\hh\CreateTest.java:46: cannot resolve symbol
[javac] symbol : constructor Track (java.lang.String,java.lang.String,java.sql.Time,java.util.Date,short)
[javac] location: class com.oreilly.hh.Track
[javac] track = new Track("Gravity's Angel",
CreateTest.java snippet
Code:
try {
// Create some data and persist it
tx = session.beginTransaction();
Track track = new Track("Russian Trance",
"vol2/album610/track02.mp3",
Time.valueOf("00:03:30"), new Date(),
(short)0);
session.save(track);
track = new Track("Video Killed the Radio Star",
"vol2/album611/track12.mp3",
Time.valueOf("00:03:49"), new Date(),
(short)0);
session.save(track);
track = new Track("Gravity's Angel",
"vol2/album175/track03.mp3",
Time.valueOf("00:06:06"), new Date(),
(short)0);
session.save(track);
// We're done; make our changes permanent
tx.commit();
Track.java snippet
Code:
package com.oreilly.hh;
import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang.builder.ToStringBuilder;
/**
* Represents a single playable track in the music database.
* @author Jim Elliott (with help from Hibernate)
*
*/
public class Track implements Serializable {
/** identifier field */
private Integer id;
/** persistent field */
private String title;
/** persistent field */
private String filePath;
/** nullable persistent field */
private Date playTime;
/** nullable persistent field */
private Date added;
/** nullable persistent field */
private Short volume;
/** full constructor */
public Track(String title, String filePath, Date playTime, Date added, Short volume) {
this.title = title;
this.filePath = filePath;
this.playTime = playTime;
this.added = added;
this.volume = volume;
}