Exclude a specific table from being created by hibernate?

后端 未结 1 1050
生来不讨喜
生来不讨喜 2021-02-07 03:54

I have an @Entity which is mapped to a view, here is how it looks

import org.hibernate.annotations.Immutable;
import javax.persistence.*;

@Table(na         


        
1条回答
  •  清酒与你
    2021-02-07 04:55

    The @Subselect annotation is the only annotation in Hibernate that prevents the creation of the corresponding table for an @Entity:

    @Entity
    @Subselect("select * from user_earning")
    public class UserFlightEarning {
    
        @Id 
        public Long userId;
    
        public Long flightId;
    
        @Column(name = "flight_seq") 
        public Long flightSequence;
    }
    

    0 讨论(0)
提交回复
热议问题