Posts by Dherik • 10,372 points
299 posts
-
0
votes1
answer269
viewsA: I can’t clone a project through Git and Visual Studio 2017
This mistake seems to be a bug of a version of Visual Studio. Try the following options: Update your Visual Studio. Uninstall your version of Git, remove Visual Studio via Visual Studio Seteup,…
-
1
votes1
answer1082
viewsA: How to access an earlier version and then go back to the latest git checkout
If you went to a specific commit and want to go back to the most recent commit on the branch, just double-check the branch itself: git checkout 123456 # hash de um commit específico git checkout…
-
8
votes4
answers25119
viewsA: How to discard all commited changes?
I have successfully used only these two commands below when I make several changes to a branch and wish to get rid of them all without having committed anything yet. The first command is to reverse…
-
1
votes2
answers2079
viewsA: How to get back to a point before merging into Github
Solving your issue by allowing the branchmerge to work again is resolved by deleting the merge commit from the branch master and, in your case, also deleting the revert commit. But first, I’ll…
-
1
votes1
answer349
viewsA: Error: 'could not read Username for 'https://github.com' while pushing
This error occurs when the git need ask the user name and password, but the only mechanism to ask for the user and password is the console and there is no console available. This usually occurs when…
-
0
votes1
answer102
viewsA: Doubts about branchs structure and repositories
And I did so in the 5 cases imagining that there would be following structure in the branches as the folders: Here’s the problem: what you did after this. You probably did the following: mkdir b1…
-
1
votes1
answer887
viewsA: I am not able to finish the merge always appears this error:
The error indicates that you still have a last merge conflict that needs to be resolved. To view the status of your current repository, use the command: git status This command will probably show…
-
2
votes2
answers646
viewsA: Enable HTTPS on Amazon Beanstalk in Spring Boot application
In fact, it seems that it is not very obvious how to do this with Spring Boot. However I don’t know exactly if I should create or edit files and directories and where, especially as in the…
-
3
votes2
answers62
viewsA: Change the end of the email domain to a random scan
I did too, otherwise: update Pessoa SET email=REVERSE(STUFF(REVERSE(email), 1, CHARINDEX('.', reverse(email)) - 1, RIGHT(REPLACE(CAST(NEWID() AS VARCHAR(36)), '-', ''), 3)))…
-
2
votes2
answers62
viewsQ: Change the end of the email domain to a random scan
Hello! I’m looking for a way to mask emails in the database, but in a way that I can reverse them without much difficulty, in case I need the real email. My idea is to create a Rigger AFTER INSERT…
-
0
votes4
answers1245
viewsA: Hibernate - How to search all rows of a table with Hibernate?
I recommend to clarify the SELECT instead of starting the query only with FROM: String jpql = "SELECT pessoa FROM Pessoa pessoa"; Query query = em.createQuery(jpql); List<Pessoa> pessoas =…
-
3
votes2
answers115
viewsA: Search information in the database with validation of Hibernate parameters
You can halve the amount of conditionals, using the approach you presented, using a Map and enjoying the same if that concatenates the conditional HQL in the query. Behold: String hql = "select v…
-
4
votes1
answer193
viewsA: JPA ordered return from the Many side of an @Onetomany entity using @Orderby
If I were you, I’d give up @OrderBy, because it would be applied in the requests for any query of the Customer entity. I recommend using JPQL to make this query: public Cliente…
-
1
votes1
answer311
viewsA: Error in git repository:
There are different reasons for this error to occur. In your case, it looks like you accidentally removed the development of the repository with git branch -D development. In this case, to solve it…
-
1
votes1
answer398
viewsA: Problems with git merge
Paulo, when weird situations like this happen with Git, you need to know which commands were used. From what you described, it seems that the merge done in the branch gave conflicts and the user…
-
6
votes3
answers1205
viewsA: What are Proxy, Gateway and Tunnel in the HTTP protocol?
I will try to explain the difference with a few examples. Just reading the definition in RFC I, particularly, have problems understanding the meaning in more practical terms. Gateway Imagine that it…
-
4
votes1
answer61
viewsA: Spring Model 4.3.1
You’re making a requisition for GET for /caixa/alterar and is not passing the value of the operating box id at the end of the URL, so you get null. In order to be able to receive the value, you…
-
10
votes3
answers1181
viewsA: Is GIT Staging Area useless?
Understand the existence of Staging Area more like a resource than an obligation to use in Git. It’s perfectly possible to work with Git without ever using Staging Area, and there is no problem…
-
2
votes2
answers217
viewsA: What’s the difference between git reset -- <file_name> and git reset HEAD <file_name>?
There is no difference between the commands below. git reset HEAD <file_name> git reset <file_name> What happens is that if you don’t mention the HEAD, Git will use by default HEAD. This…
-
0
votes1
answer135
viewsA: Native query count does not return the same type in SQL Server and H2
I remembered that I had this problem in a software I have worked on, that instead of H2 I used Hsqldb, and I consulted my former colleagues to remember the solution. It is possible to use Number and…
-
2
votes1
answer135
viewsQ: Native query count does not return the same type in SQL Server and H2
Hello, I have a native consultation that makes a simple count of records from a table: public Long contar() { String sql "SELECT count(*) FROM Order"; Query query = query.createNativeQuery(sql); //…
-
0
votes4
answers312
viewsA: Count distinct names saved in txt
You can further simplify the solution with HashSet, passing to List read from the file directly to the constructor of the HashSet: String strPath = DIRETORIO + ARQUIVO_FILE; if (pathExists(strPath))…
-
8
votes1
answer139
viewsA: How to avoid conflict of data between two PUT requests on HTTP?
You can adopt the concept of Lock Optimist to prevent a request from updating a resource using its old information as a reference. In the HTTP specification there are 2 headers (Headers) HTTP that…
-
1
votes2
answers2051
viewsA: Authentication error sending file to repository on Github
There may be different reasons for this error: Your username or password is incorrect. To ensure, remove your Github access credentials on Windows via Credential Manager and try again. You activated…
-
8
votes2
answers17606
viewsA: Why use WHERE 1 = 1 in an SQL query?
There are other interesting points to be raised for this solution with WHERE 1 = 1. Code clarity One advantage of this technique is that the code ends up staying cleaner, so there need not be…
-
2
votes2
answers5233
viewsA: How can I test method with void return using Junit?
In addition to Bruno’s answer, it is worth adding another way to test methods that return void. Often these methods belong to classes with dependencies. Classical situation when we are working with…
-
0
votes1
answer237
viewsA: How to bring a List in a JPQL query with constructor
The problem is probably that in the JPQL query you specify a variable lp which is not mentioned in the JPQL query. To fix, you can generate a new JOIN with the alias lp: JOIN…
-
5
votes4
answers8680
viewsA: What are the differences between HTTP 2 and HTTP 1.1?
The differences are several, but let’s start from the most basic change. HTTP2 is a binary protocol, other than HTTP1 which is in text format. Only with this concept we already have many…
-
0
votes1
answer245
viewsA: Relationship of one column to several
When using JPA entities and writing a JPQL, you need to reference the column names in the entity and not the column names in the table, except you want to make a native consultation (Native query).…
-
1
votes1
answer153
viewsA: Error doing Many to Many interface with Spring Boot
In general, it is not a good idea to use JPA/Hibernate entities and turn them into Json, or involve them in any other type of serialization. As it may involve circular mapping (as in your case),…
-
0
votes1
answer47
viewsA: Multiple Bags Exception / Searching multiple collections with JPA
The most common cause for this error is when you try to make 2 (or more) JOINs using FETCH, each of these JOINis by means of a List. Let’s take an example. Given the (pseudo) entities: @Entity class…
-
1
votes2
answers86
viewsA: User with more than one profile
My suggestion is to create a table usuario, a table perfil and a table usuario_perfil. The user may have more than one profile and a profile may belong to more than one user, characterizing a…
-
0
votes1
answer45
viewsA: Joins with daughter entities
Your search for the parent table will automatically bring the daughter tables regardless of your query. Why? The framework (say Hibernate) does not know if you, after taking the parent entity, will…
-
0
votes1
answer240
viewsA: How to restrict Github permissions on Windows? (To ask for password every time)
If you were asked for user and password the first time, surely you are using the repository with HTTPS. The first thing is to find out how you are storing this password. Enter the command: git…
-
0
votes1
answer85
viewsA: Git merge in windows conflicts and the line in the file is not marked
Although Linux understands it to be a text file, it doesn’t mean that Git will understand it the same way. The cause of this error is several: The archive of the repository has the encoding other…
-
1
votes1
answer49
viewsA: Upload branch information after days
As the layout is experimental, you can do as said: Create a branch with the new layout only Bring her up for approval If all goes well, you can merge this branch into the production branch (which…
-
2
votes1
answer224
viewsA: Gitkraken error to push
This error is not necessarily connected to Git. It occurred that when accessing the Git repository address, the server returned the error to you HTTP 308 (308 Permanent Redirect). If we were to take…
-
0
votes2
answers441
viewsA: Outdated branch pull request in Git
On Github, you can make a Pull Request branch mobile to the branch master. After this, this merge request will be available for evaluation. If all is right, just enter the pull request and approve…
-
1
votes2
answers377
viewsA: GIT: 2-verse project on different clients and main branch
You can use two distinct branches in the same repository. This way it will be more practical to keep the two versions separate when you need to make some changes that you want to apply to both…
-
23
votes2
answers12902
viewsA: What’s the difference between git pull and git pull --rebase
To understand the differences, nothing better than a simple example. Imagine you’re doing commits on the master branch with other people on your team. To simplify the scenario, you’re using Github…
-
1
votes1
answer121
viewsA: Heroku login error on Windows cmd
One of the causes for this error is file access permission. Check whether the file is as readonly through the file properties. If you are, weaning option and try again.…
-
1
votes1
answer137
viewsA: How do I login to a repository?
If you used to https with its repository without providing the user and password to each pull/push, probably your credentials (user and password) were saved using the credential.helper of Git…
-
7
votes2
answers3295
viewsA: How do I stop sending package-lock.json by gitignore?
If you wish remove this repository file and make it no longer versioned in it, you need to add it in the .gitignore and remove it using the command below: git rm --cached package-lock.json Now, if…
-
2
votes1
answer129
viewsA: Error pushing on gitbash
This error message may have different causes. I’ll list some, which you need to check: SSH key nonexistent on your machine SSH key is not added to ssh-agent ssh-agent is not running Your public key…
-
2
votes1
answer576
viewsA: How to pull files from the repository without generating merge commit?
You can do git rebase: git pull --rebase So git will put all the their commits at the top of the remote branch commits, without committing to merge. This is a very common complaint when using Git,…
-
0
votes2
answers3350
viewsA: Join multiple commits from a branch
If the commits you want to merge from this remote branch are latter Her commits, you need to do the squash commit on the local branch and then push to the remote branch. See an example with the…
-
2
votes1
answer103
viewsA: Prevent git merge when conflict exists
You can instruct developers who, when detecting the problem, abort the merge of git pull conflict-ridden, using: git merge --abort In the worst case, you can create some script or command alias that…
-
8
votes2
answers288
viewsA: What is a "dangling Object/commit" in git?
The dangling Objects are data that are stored in the repository but cannot be accessed by normal means, as no branch or tag points to them. It’s natural for these objects to exist in your repository…
-
3
votes2
answers22374
viewsA: How do I delete commit from a branch in Git?
Permanent deletion of a (1) commit can be done by the command below: git reset --hard HEAD~1 You can replace the 1 by the number of commits you want to remove. If this commit removed is also in the…
-
1
votes1
answer97
viewsA: SQL Alphabetical sorting with html code
You can work around the problem by creating another column in your database where you store the titles accentuated. So, when ordering, you can use this new column (titulo_com_acentos). When…