PSQLException relation does not exist. Active Objects

Mathieu Yargeau April 4, 2017

I am trying to save a relation between two objects. AT is an object that will have a Many to Many relationship with CT (which is an interface really, AT will actually have a relationship with with entities inheriting from CT, IT for example).

public interface AtToCt extends Entity {
    public AT getAT();
    public void setAT(AT at);
    public CT getCT();
    public void setCT(CT ct);
}

@Polymorphic
public interface CT extends Template {
    @ManyToMany(value = AtToCt.class)
    public AT[] getATs();
}

public interface AT extends Template {
    @ManyToMany(value = AtToCt.class)
    public CT[] getCTs();
}

public interface IT extends CT { }

@Polymorphic
public interface Template extends Entity { }


Here is the code saving the relation

final AtToCt atToct = ao.create(AtToCt.class);
atToct.setAT(at);
atToct.setCT(ct);
atToct.save();

The first line gives me an exception. The `ct` variable is an instance of `IT`. Both `at` and `ct` are valid entities taken from the database. `ao` is the ActiveObjects component from JIRA

There was a SQL exception thrown by the Active Objects library:
Database:
- name:PostgreSQL
- version:9.4.11
- minor version:4
- major version:9
Driver:
- name:PostgreSQL Native Driver
- version:PostgreSQL 9.4.1212

org.postgresql.util.PSQLException: ERROR: relation "public.AO_C3F116_AT_TO_CT_ID_seq" does not exist
Position: 16

 

3 answers

0 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 24, 2021

Hello @M Amine

As you can see in our Community Guidelines, necro-posting is not allowed in the Atlassian Community. That being said, we kindly ask you to avoid posting follow-up questions or suggesting other channels in old threads (six months or more old). 

Let us know if you have any questions.

0 votes
M Amine
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 23, 2021

ok but as you may know, other users are using internet and if they find your question it would be helpful for them to understand that there is a dedicated community for Atlassian developers. Hope it helps

0 votes
Mathieu Yargeau November 23, 2021

.

Suggest an answer

Log in or Sign up to answer