How do associated annotations such as @ OneToMany specify the fields to be queried?

How do associated annotations such as

@ OneToMany, @ OneToOne, @ ManyToMany, etc., specify the fields to be queried?

for example, the following code

@Entity
@Table(name = "db_user")
public class User{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    private String name;
    
    @JoinColumn(name="userId")
    @OneToMany()
    private List<Child> childs;
    
    //get set
}

@Entity
@Table(name = "db_Child")
public class Child{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    private String name;
    
    private Integer age;
    
    @Column(name="user_id")
    private Integer userId;
    
    //get set
}

query User will be associated with query childs. In this case, both name and age of childs have values. Is there anything I can do if I only want to query name?

Apr.09,2022

is not supported by default, but you can add bytecode enhancement, and once set, the private byte [] type can be lazy load. If you have to consider the performance of fetching a few more fields, you should write your own sql to fetch data instead of using the or mapping framework.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be6782-5445c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be6782-5445c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?