Scala Project + Scala Querydsl 2.7.0

Showing 1-6 of 6 messages
Scala Project + Scala Querydsl 2.7.0 Giuliano Costa 7/29/12 10:02 AM
Hello,


I´m followed Blog example(http://blog.mysema.com/2010/09/querying-with-scala.html) and can not run in my project. Exists any other examples utilization scala+querydsl?
Re: Scala Project + Scala Querydsl 2.7.0 Timo Westkämper 7/29/12 11:26 AM
Hi.

This blog post might be a bit out of date. The reference docs are up to date http://www.querydsl.com/static/querydsl/2.7.0/reference/html/ch02s08.html

Br,
Timo


On Sun, Jul 29, 2012 at 8:02 PM, Querydsl em nome de Giuliano Costa <querydsl+noreply-APn2wQcNHpRKUFbbE9SwLYMcY-AZHB4neU3jdQzSxASmOAD@googlegroups.com> wrote:
Hello,


I´m followed Blog example(http://blog.mysema.com/2010/09/querying-with-scala.html) and can not run in my project. Exists any other examples utilization scala+querydsl?



--
Timo Westkämper
Mysema Oy
+358 (0)40 591 2172
www.mysema.com



Re: Scala Project + Scala Querydsl 2.7.0 Giuliano Costa 7/30/12 5:03 PM
Hi!


I´m trying the reference link but line

val person = Person as "person"

is not recognized IDE(Intellij) and not compile... :(


Below my code:

trait ID extends Serializable {

  @GeneratedValue (strategy = GenerationType.SEQUENCE)
  @Column (name = "ID")
  @BeanProperty
  var id: Long = _
}

@Entity
@Table(name = "TB_PERSON")
@Model
@SerialVersionUID(13l)
class Person extends ID with Serializable {

  @BeanProperty
  @Column(name = "DS_NAME", nullable = false, length = 100)
  @Index(name = "IDX_PERSON_NAME")
  @NotNull
  @Size(min = 3, max = 100)
  var name:String = _
}
Re: Scala Project + Scala Querydsl 2.7.0 Timo Westkämper 7/30/12 11:32 PM
Hi.

I will provide you with some instructions later today.

Timo
Re: Scala Project + Scala Querydsl 2.7.0 Giuliano Costa 7/31/12 6:26 AM
Thanks Timo!




Att,
Giuliano
Re: Scala Project + Scala Querydsl 2.7.0 Timo Westkämper 7/31/12 10:55 AM
Hi.

The following should work for JPA annotated entities

    val exporter = new GenericExporter()
    exporter.setTargetFolder(new java.io.File("target/gen1-jpa"))
    exporter.setSerializerClass(classOf[ScalaEntitySerializer])
    exporter.setTypeMappingsClass(classOf[ScalaTypeMappings])
    exporter.setEmbeddableAnnotation(classOf[Embeddable])
    exporter.setEmbeddedAnnotation(classOf[Embedded])
    exporter.setEntityAnnotation(classOf[Entity])
    exporter.setSkipAnnotation(classOf[Transient])
    exporter.setSupertypeAnnotation(classOf[MappedSuperclass])
    exporter.setCreateScalaSources(true)
    exporter.export(packageToBeExported)

After that you can create variables like this

  val person = QPerson as "person"

I will update the Scala section of the reference docs for the next release.

Br,
TImo