-
-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
2 changed files
with
41 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* This file is part of alf.io. | ||
* | ||
* alf.io is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* alf.io is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with alf.io. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package alfio.repository; | ||
|
||
import alfio.model.TicketFieldConfiguration; | ||
import ch.digitalfondue.npjt.*; | ||
|
||
@QueryRepository | ||
interface FieldRepository { | ||
|
||
@Query("insert into ticket_field_configuration(event_id_fk, field_name, field_order, field_type, field_restricted_values, field_maxlength, field_minlength, field_required, context) " + | ||
" values (:eventId, :name, :order, :type, :restrictedValues, :maxLength, :minLength, :required, :context)") | ||
@AutoGeneratedKey("id") | ||
AffectedRowCountAndKey<Integer> insertConfiguration(@Bind("eventId") int eventId, @Bind("name") String name, @Bind("order") int order, @Bind("type") String type, @Bind("restrictedValues") String restrictedValues, | ||
@Bind("maxLength") Integer maxLength, @Bind("minLength") Integer minLength, @Bind("required") boolean required, @Bind("context") TicketFieldConfiguration.Context context); | ||
|
||
@Query("insert into ticket_field_description(ticket_field_configuration_id_fk, field_locale, description) values (:ticketConfigurationId, :locale, :description)") | ||
int insertDescription(@Bind("ticketConfigurationId") int ticketConfigurationId, @Bind("locale") String locale, @Bind("description") String description); | ||
|
||
@Query("update ticket_field_description set description = :description where ticket_field_configuration_id_fk = :ticketConfigurationId and field_locale = :locale") | ||
int updateDescription(@Bind("ticketConfigurationId") int ticketConfigurationId, @Bind("locale") String locale, @Bind("description") String description); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters