@@ -64,82 +64,82 @@ public long count() {
64
64
65
65
public void create (Featuregroup featureGroup ) throws FeaturestoreException {
66
66
SearchFSCommand command = getCommand (featureGroup , SearchFSCommandOp .CREATE );
67
- commandFacade . persistAndFlush (command );
67
+ persistCommand (command );
68
68
}
69
69
70
70
public void create (FeatureView featureView ) throws FeaturestoreException {
71
71
SearchFSCommand command = getCommand (featureView , SearchFSCommandOp .CREATE );
72
- commandFacade . persistAndFlush (command );
72
+ persistCommand (command );
73
73
}
74
74
75
75
public void create (TrainingDataset trainingDataset ) throws FeaturestoreException {
76
76
SearchFSCommand command = getCommand (trainingDataset , SearchFSCommandOp .CREATE );
77
- commandFacade . persistAndFlush (command );
77
+ persistCommand (command );
78
78
}
79
79
80
80
public void updateMetadata (Featuregroup featureGroup ) throws FeaturestoreException {
81
81
SearchFSCommand command = getCommand (featureGroup , SearchFSCommandOp .UPDATE_METADATA );
82
- commandFacade . persistAndFlush (command );
82
+ persistCommand (command );
83
83
}
84
84
85
85
public void updateMetadata (FeatureView featureView ) throws FeaturestoreException {
86
86
SearchFSCommand command = getCommand (featureView , SearchFSCommandOp .UPDATE_METADATA );
87
- commandFacade . persistAndFlush (command );
87
+ persistCommand (command );
88
88
}
89
89
90
90
public void updateMetadata (TrainingDataset trainingDataset ) throws FeaturestoreException {
91
91
SearchFSCommand command = getCommand (trainingDataset , SearchFSCommandOp .UPDATE_METADATA );
92
- commandFacade . persistAndFlush (command );
92
+ persistCommand (command );
93
93
}
94
94
95
95
public void updateKeywords (Featuregroup featureGroup ) throws FeaturestoreException {
96
96
SearchFSCommand command = getCommand (featureGroup , SearchFSCommandOp .UPDATE_KEYWORDS );
97
- commandFacade . persistAndFlush (command );
97
+ persistCommand (command );
98
98
}
99
99
100
100
public void updateKeywords (FeatureView featureView ) throws FeaturestoreException {
101
101
SearchFSCommand command = getCommand (featureView , SearchFSCommandOp .UPDATE_KEYWORDS );
102
- commandFacade . persistAndFlush (command );
102
+ persistCommand (command );
103
103
}
104
104
105
105
public void updateKeywords (TrainingDataset trainingDataset ) throws FeaturestoreException {
106
106
SearchFSCommand command = getCommand (trainingDataset , SearchFSCommandOp .UPDATE_KEYWORDS );
107
- commandFacade . persistAndFlush (command );
107
+ persistCommand (command );
108
108
}
109
109
110
110
public void updateTags (Featuregroup featureGroup ) throws FeaturestoreException {
111
111
SearchFSCommand command = getCommand (featureGroup , SearchFSCommandOp .UPDATE_TAGS );
112
- commandFacade . persistAndFlush (command );
112
+ persistCommand (command );
113
113
}
114
114
115
115
public void updateTags (FeatureView featureView ) throws FeaturestoreException {
116
116
SearchFSCommand command = getCommand (featureView , SearchFSCommandOp .UPDATE_TAGS );
117
- commandFacade . persistAndFlush (command );
117
+ persistCommand (command );
118
118
}
119
119
120
120
public void updateTags (TrainingDataset trainingDataset ) throws FeaturestoreException {
121
121
SearchFSCommand command = getCommand (trainingDataset , SearchFSCommandOp .UPDATE_TAGS );
122
- commandFacade . persistAndFlush (command );
122
+ persistCommand (command );
123
123
}
124
124
125
125
public void delete (Featuregroup featuregroup ) throws FeaturestoreException {
126
126
SearchFSCommand command = getCommand (featuregroup , SearchFSCommandOp .DELETE_ARTIFACT );
127
- commandFacade . persistAndFlush (command );
127
+ persistCommand (command );
128
128
}
129
129
130
130
public void delete (FeatureView featureView ) throws FeaturestoreException {
131
131
SearchFSCommand command = getCommand (featureView , SearchFSCommandOp .DELETE_ARTIFACT );
132
- commandFacade . persistAndFlush (command );
132
+ persistCommand (command );
133
133
}
134
134
135
135
public void delete (TrainingDataset trainingDataset ) throws FeaturestoreException {
136
136
SearchFSCommand command = getCommand (trainingDataset , SearchFSCommandOp .DELETE_ARTIFACT );
137
- commandFacade . persistAndFlush (command );
137
+ persistCommand (command );
138
138
}
139
139
140
140
public void delete (Project project ) {
141
141
SearchFSCommand command = getCommand (project , SearchFSCommandOp .DELETE_PROJECT );
142
- commandFacade . persistAndFlush (command );
142
+ persistCommand (command );
143
143
}
144
144
145
145
private SearchFSCommand getCommand (Featuregroup featureGroup , SearchFSCommandOp op ) throws FeaturestoreException {
@@ -207,4 +207,10 @@ private SearchFSCommand getCommand(Project p, SearchFSCommandOp op) {
207
207
command .setOp (op );
208
208
return command ;
209
209
}
210
+
211
+ private void persistCommand (SearchFSCommand command ) {
212
+ if (command != null ) {
213
+ commandFacade .persistAndFlush (command );
214
+ }
215
+ }
210
216
}
0 commit comments