History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-25799
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Gregory Shrago
Reporter: Frédéric Donckels
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Good code is red: @OrderBy annotation

Created: 03 Apr 08 13:36   Updated: 11 Apr 08 09:11
Component/s: J2EE.EJB3
Fix Version/s: Diana 8375, Selena 7.0.4

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 7,757
Fixed in build: 8,287
Severity: Low


 Description  « Hide
The @OrderBy annotation is shown with red for "priority" in the following code, which is correct and works in hibernate:

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
public class Container {

// ----- instance fields -----

List<Content> content = new ArrayList<Content>();

private int id;

// ----- public methods -----

@OneToMany(targetEntity = Content.class)
@Cascade(CascadeType.ALL)
@JoinColumn(name = "CONTAINER_ID", nullable = false)
@OrderBy("priority ASC")
public List<Content> getContent() { return content; }

public void setContent(List<Content> content) { this.content = content; }

@Column(name = "ID", nullable = false)
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public int getId() { return id; }

public void setId(int id) { this.id = id; }
}



import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class Content {

// ----- instance fields -----

int id;

int priority;

// ----- constructors -----

public Content(int priority) { this.priority = priority; }

public Content() {
}

// ----- public methods -----

@Id
@Column(name = "ID", nullable = false)
@GeneratedValue(strategy = GenerationType.AUTO)
public int getId() { return id; } }

public void setId(int id) { this.id = id; }

public int getPriority() { return priority; }

public void setPriority(int priority) { this.priority = priority; }
}



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.