@@ -1739,8 +1739,9 @@ class GenericDB
17391739 private $ database ;
17401740 private $ pdo ;
17411741 private $ reflection ;
1742- private $ columns ;
1742+ private $ definition ;
17431743 private $ conditions ;
1744+ private $ columns ;
17441745 private $ converter ;
17451746
17461747 private function getDsn (String $ address , String $ port = null , String $ database = null ): String
@@ -1916,9 +1917,6 @@ public function selectAll(ReflectedTable $table, array $columnNames, Condition $
19161917 if ($ limit == 0 ) {
19171918 return array ();
19181919 }
1919- if (!$ columnOrdering ) {
1920- return $ this ->selectAllUnordered ($ table , $ columnNames , $ condition );
1921- }
19221920 $ selectColumns = $ this ->columns ->getSelect ($ table , $ columnNames );
19231921 $ tableName = $ table ->getName ();
19241922 $ condition = $ this ->addAuthorizationCondition ($ condition );
@@ -3222,7 +3220,7 @@ public function handle(Request $request): Response
32223220
32233221class DefaultOpenApiDefinition
32243222{
3225- private $ root = [
3223+ protected $ root = [
32263224 "openapi " => "3.0.0 " ,
32273225 "info " => [
32283226 "title " => "JAVA-CRUD-API " ,
@@ -3281,7 +3279,7 @@ private function set(String $path, String $value) /*: void*/
32813279 public function setPaths (DatabaseDefinition $ database ) /*: void*/
32823280 {
32833281 $ result = [];
3284- foreach ($ database ->getTables () as $ database ) {
3282+ foreach ($ database ->getTables () as $ table ) {
32853283 $ path = sprintf ('/records/%s ' , $ table ->getName ());
32863284 foreach (['get ' , 'post ' , 'put ' , 'patch ' , 'delete ' ] as $ method ) {
32873285 $ this ->set ("/paths/ $ path/ $ method/description " , "$ method operation " );
@@ -3830,6 +3828,11 @@ public function getColumnOrdering(ReflectedTable $table, array $params): array
38303828 $ pk = $ table ->getPk ();
38313829 if ($ pk ) {
38323830 $ fields [] = [$ pk ->getName (), 'ASC ' ];
3831+ } else {
3832+ foreach ($ table ->columnNames () as $ columnName ) {
3833+ $ fields [] = [$ columnName , 'ASC ' ];
3834+ }
3835+
38333836 }
38343837 }
38353838 return $ fields ;
0 commit comments