Questions tagged as 'java'

0
answers

CDI bean that goes up with the application

Is there a way to start a CDI bean next to the application I have the following bean: @ApplicationScoped @Named public class MyBean implements Serializable { @Inject private Helper helper; @PostConstruct public void init()...
asked by 17.08.2018 / 21:08
1
answer

Array conversion to two-dimensional array using parameter

I have a question regarding the conversion of vectors (array) to two-dimensional vectors. I need to read a string and separate the columns when there is a blank space. I did this using the split() method and it's already ok. However, w...
asked by 19.08.2018 / 16:09
0
answers

Error @DatabaseField + Abstract class ORMLite (java.lang.IllegalArgumentException: No fields have a DatabaseField annotation in class ***. Object)

I have a class that extends from the object class (abstract) from which I need to save the fields in the database, but the ormlite asks the object class to have some field with the @DatabaseField annotation only that I do not need to save anythi...
asked by 21.06.2018 / 20:39
1
answer

Permutations of integers

I have the following problem: Given an entry n I have to calculate the number of permutations possible with the digits that compose it. For example, if n = 123 I have 6 numbers that can be formed: 123 , 132 , 231...
asked by 24.02.2018 / 01:39
4
answers

How to compare Strings in Java?

The == operator says that the Strings are different, and they store the same literal value, see example: public class TesteString { public static void main(String[] args) { String str1 = "teste"; String str2 = "Otes...
asked by 03.02.2014 / 16:19
0
answers

Include and remove elements of a Json with the Gson (Java)

I'm using the Gson library in Java, I have the following structure in a json file: {"idAluno":4, "nomeAluno":"Teste da Silva", "listaDeTurmas":[1,2,4]} Is it possible, with this library, to change the "list ofTurmas" entry to include / remo...
asked by 07.04.2018 / 22:26
0
answers

A help with annotations with Spring Boot

A help with annotations ... Today my tests are like this: @ConfigA @ConfigB @ConfigC @ConfigD public class MeuTesteA {} @ConfigA @ConfigB @ConfigC @ConfigD public class MeuTesteB {} See, I have to repeat many configuration annotations. To...
asked by 18.05.2018 / 21:45
1
answer

SQLite android query () / like with accents and without

How to make a query in SQLite for Android that looks for both accented and unstressed words? For example: String[]ARGUMENTOS = {"%"+argumento+"%"} query(TABELA_CIDADES, COLUNA_NOME, NOME + " like ?",ARGUMENTOS,null,null,null,null); Wh...
asked by 29.01.2016 / 12:43
0
answers

How to change the @GeneratedValue used by Spring through Spring's AbstractPersistable class?

I'd like to use @GeneratedValue(strategy = GenerationType.SEQUENCE, ... ... when I'm extending the class AbstractPersistable , but I do not know if that's possible. From what I saw in the documentation, the class AbstractPersi...
asked by 19.05.2018 / 12:41
0
answers

What is the best way to map entity with JPA composite key?

I have two tables to map to two entities. I need to list it on the screen like this: Id | Produto | Cliente | Razão Social | País | Estado ----------------------------------------------------------------- 1 | TV | 000001 | Jao da Si...
asked by 23.05.2018 / 15:17