robert trudel

1

votes
0

answer
78

views

Counting success and failed authentication

I use spring boot 2 in a thymeleaf application I created a class config for authentication @Configuration public class AuthenticationConfig { @Bean public AuthenticationSuccessEventListener asel() { return new AuthenticationSuccessEventListener(); } @Bean public AuthenticationFailureListener afel()...
robert trudel
1

votes
0

answer
600

views

How to cache js, img and CSS file with Spring Boot?

I use Spring Boot 2 with Spring Security and Thymeleaf. I have a setup for MVC and REST. I search a way to cache JavaScript, image and CSS files. @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) public class MultiHttpSecurityConfig { ... @Configuration @Order(1) public class Res...
robert trudel
1

votes
0

answer
26

views

put a default value to do a inner join instead of left or right join

In relation between two table is it a good idea in term of performance to put a default value to do an inner join instead of left or right join?
robert trudel
1

votes
0

answer
167

views

Set Default paging null

I use spring boot 2 Seem like spring boot put a default value for pageable, if user put nothing... I would like to get null or nothing... @GetMapping(value = 'networks') public ResponseEntity getNetworks(@RequestParam(required = false) String search, Pageable page) { } So I tried to put @requestpara...
robert trudel
1

votes
1

answer
103

views

Join and inheritance jpa

I use spring data, jpa with hibernate implementation I am writing a advanced search public class Samples extends BaseEntity{ .. @Id @ManyToOne @JoinColumns({ @JoinColumn(name = 'sampling_id', referencedColumnName = 'id'), @JoinColumn(name = 'sampling_year', referencedColumnName = 'year')}) private...
robert trudel
1

votes
0

answer
125

views

Saving entity with composite key get ConversionNotSupportedException

I use spring boot 2 and some of my entities have composite key When I try to save an entity, I get this error Failed to convert request element: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.Integer' to required type 'com.lcm.model.Sam...
robert trudel
1

votes
1

answer
41

views

Package missing in hibernate source

I need to create a test for hibernate, so I done a fork of hibernate. I opened source file in Intellij. When I try to run a test I get: Error:(35, 42) java: package org.hibernate.jpamodelgen.xml.jaxb does not exist I use openjdk 8 and gradle. seem ok.... but still same error...
robert trudel
1

votes
3

answer
35

views

Button side by side

I try with bootstrap 4 to have a button with another button drowdown to its right Actually button is displayed on separate row http://jsfiddle.net/2jx14skv/ Recherche Exportations Excel Pdf how to get them side by side?
robert trudel
1

votes
0

answer
31

views

Log don't display all the data

I se spring boot 2. I have a method who use a scheduler. I try to log some info @Scheduled(cron = '0 52 8 * * *') private void sendEmailOrders() throws MessagingException { List factoryEmails = prepareDataNoncompliantSampling(); log.info('start sendEmailOrders: ' + factoryEmails != null ? String.val...
robert trudel
1

votes
1

answer
209

views

Jquery Ajax call return an error but work with curl

I do a ajax call with jquery $('#lodgerSearch').on('click', function (e) { var searchParam = $('#srch-term').val(); var url = 'http://localhost:8080/lodgers/search'; if(searchParam!=''){ url = 'http://localhost:8080/lodgers/search?searchTemp=' + searchParam; } jQuery.ajax({ type: 'GET', url: url, s...
robert trudel
1

votes
2

answer
589

views

Debugging javascript in a single page application

In a single page application, I load a different html page with jquery. $('#lodger').click(function () { $('#main').load('lodger.html'); }); In my page lodger.html, I have some javascript directly in the page. Is there a way to debug it? I haven't found a way to do it with Chrome
robert trudel
1

votes
1

answer
33

views

JPA and order warranty

I use jpa. I have a rent object who contain a list of payment. (one to many relation). In database for rent rentId 1 2 3 For payment paymentId, payment, rentId 1 20 1 2 20 2 3 15 3 4 10 2 Is it warranty with JPA then if we get a rent, list...
robert trudel
1

votes
1

answer
41

views

How to do an action after an AJAX call is done? [duplicate]

This question already has an answer here: How do I return the response from an asynchronous call? 33 answers I try to call a function at different place. That why i return true or false. Problem i got is before hasCreditCard has time to do is call, that go directly to the else... if (hasCreditCard(...
robert trudel
1

votes
1

answer
610

views

spring boot, jackson and localdate

I use spring boot with mysql in my application.properties spring.jpa.generate-ddl=true spring.jackson.serialization.write-dates-as-timestamps=false In my build.gradle I have compile('org.springframework.boot:spring-boot-starter-data-jpa') compile('org.springframework.boot:spring-boot-starter-data-re...
robert trudel
1

votes
1

answer
962

views

See query generated with spring data - jpa

I done a git clone of spring data - jpa. I search a way when I running test to see generated query.
robert trudel
1

votes
2

answer
1.7k

views

How can I reload my changes on Spring Boot without having to restart my server?

I use spring boot 2.0.0 with netbeans 8.2 and gradle. I use compile('org.springframework.boot:spring-boot-devtools') How to avoid to restart every time server when i do a change in the code ?
robert trudel
1

votes
1

answer
565

views

Query By example and boolean field

In class Users, I have a field id, firstname, lastname, username, password, enabled. Enabled field is boolean When i use do this query by example with spring Users users = new Users(); users.setId(12); Example example = Example.of(users); Page pageUsers = userRepository.findAll(example, page); In th...
robert trudel
1

votes
1

answer
963

views

Inline javascript with thymeleaf escaping character

I use thymeleaf and spring. I try to do inline javascript. $('#genericTable').bootstrapTable({ url: /*[[${url}]]*/ 'generic', ... }); On the server side I do model.addAttribute('url', '/rest/vehicles'); I get url: '\/rest\/vehicles', Why some caracters are added to the string? Edit with url: /*[...
robert trudel
1

votes
1

answer
30

views

Typeahead and first cell selector

I have this table Name Description When a click on a link, I add a row. That work fine. In the first column of the row, I add an jquery-typehead Selector is not working, also would like to avoid it for first row (th header) $('#vehicleParamTable tr td:first-child').typeahead({ minLength: 2, display:...
robert trudel
1

votes
1

answer
37

views

Reuse a composite key for a child + a new field

I use spring boot, with jpa (hibernate) and postgresql I use composite key. @Entity @IdClass(SamplingsPK.class) @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class Samplings { @Id @GeneratedValue private Integer id; @Id private int year; @OneToMany(mappedBy = 'sampling', cascade = Cas...
robert trudel
1

votes
1

answer
53

views

Not right date is displayed

I use this daterangepicker: https://github.com/dangrossman/daterangepicker I receive a date from database: so the format is: YYYY-MM-DD Web client don't necessary use this format. I tried that $('#samplingsBuildDatePicker').daterangepicker({ singleDatePicker: true }); var dateStart = moment('201...
robert trudel
1

votes
1

answer
544

views

Search nested object with spring data, Illegal attempt to dereference path source

I use spring data jpa, I have these classe (each one have id... not displayed) public class HOV{ @ManyToOne(optional = false, fetch = FetchType.LAZY, cascade = {CascadeType.MERGE, CascadeType.PERSIST}) @JoinColumn(name = 'vehicle_type_id') private VehicleTypes vehicleType; ... } public class Vehicle...
robert trudel
1

votes
1

answer
0

views

Hikari and test on borrow option

I use spring boot 2 with Hikari connection pool, jpa and postgres. Is there any reason to continue to use theses options spring.datasource.testOnBorrow=true spring.datasource.validationQuery=SELECT 1 spring.datasource.testWhileIdle
robert trudel
1

votes
1

answer
0

views

thymeleaf part is not interpreted in js

I use thymeleaf In a js function I create a row. Issue is the thymeleaf part is not interpreted so thymeleaf code is still in the code. function addRow(tableId, letter){ var row=` ${letter} /*[# sec:authorize='hasAnyRole('ROLE_ADMIN', 'ROLE_USER')']*/ /*[/]*/ `; ... } Look like ` character cause...
robert trudel
1

votes
1

answer
0

views

Mapping with and without /

I use spring boot, thymeleaf, tomcat I give 3 case of call server from ajax call case 1 ajax url: /sampling mvc (mapping) sampling that work case 2 ajax url: sampling mvc (mapping) sampling that don't work case 3 ajax url: /sampling mvc (mapping) /sampling that work why case 1 is working, on the s...
robert trudel
1

votes
2

answer
96

views

display a dialog when i click a button

i ty to display a dialog when i click on a button in my js part i have $('#dialog').dialog({ autoOpen: false }); $('#create-report').click(function() { $('#dialog').dialog('open'); }); in my html part i have hi how are you Create new report nothing is displayed and i don't have any error why?
robert trudel
1

votes
1

answer
565

views

No pdf generated

i use jsPDF and plugin jsPDF-AutoTable I have a html table i want to print $('#printFreeRoom').on('click', function (e) { freeRoomAvailableReport($('#freeRoomTableResult')); }); function freeRoomAvailableReport(tableId) { var doc = new jsPDF('p', 'pt'); doc.text('From HTML', 40, 50); var res = doc.a...
robert trudel
1

votes
1

answer
278

views

$.parseJSON(…).each is not a function

In a js file, i have the code below. With this syntax is ok $(jQuery.parseJSON(category)).each(function() { $(selector).append($('').text(this.name).attr('value', this.contactCategoryId)); }); With this one that fail $.parseJSON(category).each(function () { $(selector).append($('').text(this.name)...
robert trudel
0

votes
0

answer
3

views

Duplicate data in the child object

I use spring boot 2.1 with spring data jpa and hibernate @Entity public class Factories{ @Id @SequenceGenerator(name = 'factories_id_seq', sequenceName = 'factories_id_seq', allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = 'factories_id_seq') private Integer id; @O...
robert trudel
1

votes
1

answer
1.2k

views

Projects, Files, Services, Navigator color background

In netbeans when we choose a profile in fonts & colors option screen that change editor windows background color but not one in project, files, service navigator. like you can see in the picture i'm the only one with this issue? Edit seem like impossible NetBeans, theme with black background
robert trudel
0

votes
0

answer
4

views

Display unicode character

I use spring boot 2 with thymeleaf 3. I try to display an unicode character I get this error There was an unexpected error (type=Internal Server Error, status=500). Exception evaluating SpringEL expression: 'specialTry ? ☑ : ''' I tried th:utext='${sample.specialTry} ? '☑' : ''' only # is displa...
robert trudel
1

votes
1

answer
347

views

Build with parameters with java 8

I use spring, java 8 and gradle. In Java 8, you can use reflection to access names of parameters of methods. This makes the @Param annotation unnecessary, since Spring can deduce the name of the JPQL parameter from the name of the method parameter. http://docs.oracle.com/javase/tutorial/reflect/memb...
robert trudel
1

votes
2

answer
1.4k

views

JPA update with a join

I use spring-jpa with hibernate implementation. I use mariadb I try to do an update with a join. My object structure @Entity public class Room { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long roomId; @ManyToOne @JoinColumn(name = 'appartment_id') private Appartment appartment; }...
robert trudel
1

votes
1

answer
29

views

Feed a list with the last value

I have theses entity and I do this query. select r from RentAmount r Join r.lodger l join l.bailList b where r.unpaidBalance > 0 and (r.paymentDueDate > :date or r.paymentDueDate is null ) and b.paymentPeriod= order by r.rentAmountId') Is there a way to feed Lodger.bailList only with the last bail...
robert trudel
1

votes
1

answer
27

views

Loop via a each but function unknown

I get json value and i loop on rentFeatureOption. This part work. { 'bailId': 2, 'fromDate': '2016-03-11', 'toDate': null, 'lodgerId': 1, 'supportTwoPerson': false, 'lodgerPayforTwo': false, 'roomId': 1, 'appartmentId': 1, 'price': 500.0, 'paymentPeriod': 'WEEK', 'address': '460 Ch. Chambly, Lon...
robert trudel
1

votes
1

answer
228

views

Reflection and thymeleaf

I use spring boot and thymeleaf. I have many entity and I need to create crud ui. All ui will be similar Is it possible to use reflection to reduce ui to generate? I would like to loop on the fields and get value in the thymeleaf template
robert trudel
1

votes
2

answer
379

views

Strategy pattern in a spring controller

In a spring boot application, In one of my controller, I used a strategy pattern to feed some data. @Component public class SearchStrategy extends AbstractStrategy implements Strategy { //spring ui model private final Model model; public SearchStrategy(Model model) { super(model); this.model = model...
robert trudel
1

votes
1

answer
521

views

Use returned server parameter to display data

I tried to use jQuery DataTables. Before I used bootstrap table. On the server, I use spring boot, spring data with paging. memberId name phone1 phone2 email $('#example').DataTable({ 'processing': 'true', 'serverSide': 'true', 'ajax': { 'url': '/rest/members', 'data': function (d) { return { search...
robert trudel
1

votes
1

answer
2.3k

views

Compare int and string in thymeleaf

I use thymeleaf 3 with spring boot 2 have a integer and a string to do a compare i tried ${car.id}==${generic.value}' but it's always false
robert trudel
0

votes
0

answer
3

views

UnsupportedOperationException with use fetch instead of join

I use spring boot 2 with spring data jpa and hibernate implementation I do a custom search public Page advancedSearch(SamplesSearchDto search, Pageable page) { Specification specification = genericAdvancedSearch(search); return this.findAll(specification, page); } My genericAdvancedSearch method Spe...
robert trudel

View additional