I'm interested in calculating permutations for parameters for something like this:
public class Movie() {
@Selection(minimum=1,maximum=10)
public Integer setLength() {}
@Selection(minimum=1.1,maximum=5.5)
public Double setCost() {}
}
So I can write something like List getPermutations(); so that I could get a list of eve...
Hi,
I would like add an annotation similar to @RequestParam, though have it pull the values from the request attribute rather than the request param...
Is there an example or explanation how to create my own annotation for this and the handler / binder needed as well?
Thanks
...
I'm annotating my DAOs and using hibernate3:hbm2ddl to generate the ddls. Is there a way to annotate the tablespace?
...
I have a requirement to create a component which can be used stand-alone or within a larger application. When used stand-alone, it should not require a database, nor any database/ORM related dependencies. When used as as part of a larger app, some of the classes will indeed be persisted to a database via JPA/Hibernate.
I was thinking ...
Consider the following domain model:
Issue
- id
- List<Comment>
Entry
- id
- List<Comment>
Comment
-id
-comment
In my design, I was attempting to create two join tables to manage the associations; issue_comments, and entry_comments. I assumed @OneToMany on Issue & Entry, but how do you map the multiple join tables? Using hibernate ...
I am having trouble setting the type of a String, it goes like
public void setTextDesc(String textDesc) {
this.textDesc = textDesc;
}
@Column(name="DESC")
@Lob
public String getTextDesc() {
return textDesc;
}
and it didn't work, I checked the mysql schema and it remains varchar(255), I also tried,
@Column(name="DESC", length="900...
I have set up an annotation that will be used to keep track of classes, however I am getting an error when I try to compile any java code that uses the annotation.
Here is the annotation code:
package tlib.anno;
import java.lang.annotation.*;
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.TYPE )
public @interface Class
{...
I'd like to integrate existing application with JasperReports. However, when creating report with iReport the wizard is asking me for hibernate.hbm.xml. Since I'm using annotations I simply don't have one. Does iReport work with Hibernate annotations? If so, how can I configure iReport?
...
I have the following 2 models:
class Job(models.Model):
title = models.CharField(_('title'), max_length=50)
description = models.TextField(_('description'))
category = models.ForeignKey(JobCategory, related_name='jobs')
created_date = models.DateTimeField(auto_now_add=True)
class JobCategory(models.Model):
title = m...
Hello.
I have 2 entities: User and UsersList.
@Entity
@Table(name = "USERS")
public class User {
@Id
@GeneratedValue
@Column(name = "ID")
private Long id;
@ManyToMany(cascade = CascadeType.REMOVE, mappedBy = "users")
private List<UsersList> usersLists = new ArrayList<UsersList>();
public List<UsersList> ge...
How can you reference an annotation as a code snippet properly in Javadoc?
For example:
<code>
@Annotation public String field = "";
</code>
The @Annotation gets treated as an unrecognized Javadoc tag rather than a code snippet.
...
I freaking loosing my mind on this:
I have this code:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ANetApiResponseType", propOrder = {
"resultCode",
"messages"})
and I get this error:
Type mismatch: cannot convert from XmlAccessType to AccessType
I've googled , but all these problems usually occur because some...
Is there a way to have an action filter, like
public class MyActionFilterAttribute : ActionFilterAttribute {
public override void OnActionExecuting(ActionExecutingContext context) {
...
be automatically applied to all actions in a web site?
...
Hi Folks,
I've been experimenting with the jsr 305 annotations for use with Findbugs, specifically the @CheckForNull annotation which would have avoided a bug I just found making it out to customers. I've added jsr305.jar and annotations.jar to my build path but the bugs aren't found by findbugs. I'm using Eclipse with the Eclipse Findb...
Background: I have created an application that allows users to submit an entry to an online database, and view other entries from that database. These entries contain geocodes for latitude and longitude which are used for positioning the annotations on the MapKit. Users can submit the location using either their current location or an ad...
Does anyone know how I can get the latest coordinated of my annotation after I've dragged a map annotation from a callout of the annotation? How can I access that info? Any code samples would be appreciated.
Thanks,
Zap
...
I'd like to configure this mapping with annotations instead of XML.
Here's the mapping config (sanitized for public consumption):
<hibernate-mapping package="com.test.model">
<class name="Parent" table="parent">
<composite-id name="id" class="ParentCompositeKey">
<key-property name="first_id" type="long" column="first_i...
Hi.
I have class that represents users. Users are divided into two groups with different id.
Could i make something like "if statement", so if (id==1) set annotation on field @XMLTransient
Or the only one way to do this is to create two separate classes ?
...
I'm in the process of creating exercises in how to write a plug-in to a system integration tool. We will have the correct answers implemented for demonstration after exercises, but the students will receive source where some methods are empty and just have a comment with a TODO in them describing what they should do.
To avoid duplicati...
Although I'm a fan of using annotations, I do have concern over the dependencies they create on third party jars.
For the purpose of this question, I'm referring specifically to Hibernate or JPA annotations on domain model classes.
In reality, I want my domain model to consist of simple POJOs without any dependencies on a persistence ...