JDBI中的@Bind和@BindBean有什么区别?

What is the difference between @Bind and @BindBean in JDBI?

JDBI中的@Bind@BindBean有什么区别?

示例代码:

@SqlUpdate("insert into myObject (id, name) values (:id, :name)")
int insert(@BindBean MyObject myObject);

@SqlQuery("select id, name from myObject where id = :id")
MyObject findById(@Bind("id") long id);

来自JDBI docs

The @Bind annotation binds a single named argument. If no value is specified for the annotation it will bind the argument to the name it.

The @BindBean annotation binds JavaBeans™ properties by name. If no value is given to the annotation the bean properties will be bound directly to their property names. If a value is given, the properties will be prefixed by the value given and a period.