Column not found when searching in Play! 1.2.5 and Siena 2.0.7 module

52 views
Skip to first unread message

Antonio de Sousa Barroso

unread,
Oct 25, 2012, 1:47:04 AM10/25/12
to siena-...@googlegroups.com
Hi everyone,
I have installed Play! 1.2.5 and siena 2.0.7 and when I try to perform a search the following error occurs:

org.h2.jdbc.JdbcSQLException: Error creando ├│ inicializando trigger "FT_SPORT_TYPES" objeto, clase "siena.jdbc.h2.FullText$FullTextTrigger", causa:
"java.sql.SQLException: Column not found: landmark_id"; vea la causa raiz para mas detalle
Error creating or initializing trigger "FT_SPORT_TYPES" object, class "siena.jdbc.h2.FullText$FullTextTrigger", cause: "java.sql.SQLException: Column not found: landmark_id"; see root cause for details; SQL stat
ement:
CREATE TRIGGER IF NOT EXISTS "PUBLIC"."FT_SPORT_TYPES" AFTER INSERT, UPDATE, DELETE ON "PUBLIC"."SPORT_TYPES" FOR EACH ROW CALL "siena.jdbc.h2.FullText$FullTextTrigger" [90043-166])

I leave the class below with the data model and the method that generates the error is searchByName:

@Table("sport_types")
public class SportType extends EnhancedModel {

@Exclude
@Column("type_id")
@Id(Generator.AUTO_INCREMENT)
public Long id;
@Required
@Column("type_name")
@Index("type_name_index")
public String name = "";
@Referenced
public Landmark defaultLandmark;

@Referenced
public Landmark promotedLandmark;

// Search by name
public static List<SportType> searchByName(String name, int page, int rowsPerPage) {
return SportType.all().search(name, "name").fetch(rowsPerPage, (page - 1) * rowsPerPage);
}
}

@Table("landmarks")
public class Landmark extends EnhancedModel {
...

@Exclude
@Column("landmark_id")
@Id(Generator.AUTO_INCREMENT)
public Long id;

// standard & promoted
@Column("landmark_category")
@Index("landmark_category_index")
public String category;
@Column("landmark_icon_name")
public String iconName;
@Column("landmark_icon_path")
public String iconPath;

        ...
}

Thanks in advance,
Antonio

Pascal Voitot Dev

unread,
Oct 25, 2012, 2:49:34 AM10/25/12
to siena-...@googlegroups.com
Hi,

This might be a little bug... Is this column present?
Can you try to locate the pb and correct it if possible?

(I don't maintain Siena anymore as I work on other opensource projects so don't hesitate to contribute)

Thanks
Pascal

--
You received this message because you are subscribed to the Google Groups "Siena" group.
To view this discussion on the web visit https://groups.google.com/d/msg/siena-discuss/-/YQgM2vLnKKIJ.
To post to this group, send email to siena-...@googlegroups.com.
To unsubscribe from this group, send email to siena-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/siena-discuss?hl=en.

Antonio de Sousa Barroso

unread,
Nov 1, 2012, 11:02:56 AM11/1/12
to siena-...@googlegroups.com
Thanks for your reply Pascal,

the column not found is the referencedColumnName of the relationship, the primary key of the entity (model) on the other end.

So, what is the correct way to annotate a OneToOne relationship in siena 2.0.7?

Thanks,
Antonio

Antonio de Sousa Barroso

unread,
Nov 2, 2012, 3:20:16 AM11/2/12
to siena-...@googlegroups.com
Hi,

It seems that the problem is solved when I add the annotation @Column referencing the field of the current entity (fk in the model), not that is indicated in the error.

Thanks
Antonio
Reply all
Reply to author
Forward
0 new messages