Insert in table - strange value

Asked

Viewed 36 times

0

I am trying to insert a value into a table from a select option.

html:

<select class="form-control" name="chaveCadastro" ng-options="cadastro.cadastroId for cadastro in (cadastro | orderBy:'id' | filter:{active:true}) track by cadastro.id" ng-model="cad.cadGeral.chaveCadastro"  id="cadastro">
</select>

angular:

cadGeral = result.data.value;

console.log(cad.cadGeral.chaveCadastro.id);

java:

public class cadGeral extends IdentityObject { 

    private static final long serialVersionUID = 1L; 
    @Column(name = "fk_cadastro") 
    public Cadastro chaveCadastro;

In console.log comes correct.

In Insert, the field is going with a value nothing to see type always the same: 1864385090. I suspect you are trying to insert the whole object and not the value I want, the id.

In html I cannot do by example ng-model="cad.cadGeral.chaveCadastro.id" error does not recognize id.

How do I from this keyCheck object only get the id in html and not the whole object?

  • Where JAVA enters this problem?

  • public class cadGeral extends Identityobject { private Static final long serialVersionUID = 1L; @Column(name = "fk_register") public Registration key;

  • here I treat the table in java

  • Just a hint. Java classes are always started with uppercase letters!

  • Tip, try to format the code when adding, do not paste the question anyway, it disturbs the reading of the question and who will help you. Always remember to make life easier for those who will help you by providing a clear and well-formatted question, so the chance to get answers.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.