Hi everybody,
so i do have at least 5 hibernate books but...
I have a question about ManyToMany relationships.
Say I have
Code:
@Entity
public abstract class Versionable
{
private String name
private String version;
}
@Entity
public class File extends Versionable
{
@ManyToMany(mappedBy="files")
private Liste<Project> fromProjects;
}
@Entity
public class Project extends Versionable
{
@ManyToMany
private Liste<File> files;
}
How can i express that within the Project.files list
the File.name is unique. So it is not possible that a
Project uses a File.name="Readme.txt" with File.version
="1.1" and a second, with same name but File.version="1.2"
Many thanks in advance
Dietmar