user1386966
user1386966

Reputation: 3392

How to handle hibernate mapping Column error?

I'm using Java class as an Entity that should be mapped to a sql table. My problem is that I have one field that I don't want it to be a coulmn, but when running my .war -> I get org.hibernate.mapping.Column error.

Is there a way I can add it without converting it to a Column?

@Entity
@Table(name = "queue", indexes = {@Index(name = "fileSha1", columnList = "fileSha1"),
    @Index(name = "fileSha256", columnList = "fileSha256"),
    @Index(name = "fileMd5", columnList = "fileMd5")})
public class MyQueue{

 // HERE - I don't want it as a column
protected List<enum> parts_codes = new ArrayList<>();

@Column
protected String Method;

@Column
protected String profileName = "test";


@Column
private String downloadUrl;

Upvotes: 1

Views: 32

Answers (1)

alexey
alexey

Reputation: 622

With @Transient annotation the field will be ignored by entity manager.

Upvotes: 4

Related Questions