yjp před 1 rokem
rodič
revize
5e8866a721

+ 1 - 1
convenient/relation/one2one/service.go

@@ -235,7 +235,7 @@ func QueryWithOtherInfo[FI any, TI any](fromTableName string, toTableName string
 			TableName:  toTableName,
 			Conditions: sql.NewConditions().Equal(toRelationColumnName, existFromEntity.GetID()),
 		})
-		if err != nil {
+		if err != nil && !database.IsErrorDBRecordNotExist(err) {
 			return zeroRetMap, err
 		}
 

+ 3 - 3
convenient/relation/one2one/simple.go

@@ -193,7 +193,7 @@ func WithDisableLeftUpdate() Option {
 	}
 }
 
-func WithDisableLeftQuery[LI any, RI any]() Option {
+func WithDisableLeftQuery() Option {
 	return func(options *Options) {
 		options.disableLeftQuery = true
 	}
@@ -205,13 +205,13 @@ func WithDisableRightUpdate() Option {
 	}
 }
 
-func WithDisableRightQuery[LI any, RI any]() Option {
+func WithDisableRightQuery() Option {
 	return func(options *Options) {
 		options.disableRightQuery = true
 	}
 }
 
-func WithDisableLeftWithRightQuery[LI any, RI any]() Option {
+func WithDisableLeftWithRightQuery() Option {
 	return func(options *Options) {
 		options.disableLeftWithRightQuery = true
 	}

+ 1 - 1
examples/examples/project/application/service/student_and_family.go

@@ -21,7 +21,7 @@ func (app *StudentAndFamily) Destroy() error {
 func (app *StudentAndFamily) v1(appInstance *application.App) {
 	v1Binder := appInstance.Binder(application.RouterPrefix, "v1")
 
-	one2one.BindSimple(v1Binder, &one2one.Simple[*student.Info, *family.Info]{
+	one2one.BindSimple(v1Binder, &one2one.Simple[student.Info, *family.Info]{
 		Left:                          &student.Entity{},
 		Right:                         &family.Entity{},
 		LeftTableName:                 student.TableName,