HQL with fully qualified class name

后端 未结 3 1038
轮回少年
轮回少年 2021-01-20 10:30

Let\'s say I have entity Foo like -

package com.some.company.model;
// imports
@Entity
public class Foo{
    @Id
    private Long id;    

    // getters / s         


        
3条回答
  •  星月不相逢
    2021-01-20 11:03

    I don't think it makes a difference, but... I prefer unqualified name simply because it is shorter and it makes my HQL easier to comprehend. The only reason I can think of to use fully qualified name is you have 2 different Foo entities (say, from different packages), in this case, I would much rather map them into different entity names (say, AFoo, BFoo) rather using fully qualified names to differentiate them.

提交回复
热议问题