/** * Create an instance of {@link Id } */ public Id createId() { return new Id(); }
Attribute a=values.stream().filter(value -> value.getOrder("order") == order).findAny() .orElseThrow(() -> new RuntimeException("Could not find value of order " + order)); Id id=a.getId(); if(id==null) throw new RuntimeException("Value of order " + order + " has no id"); String name=id.getName(); if(name==null) throw new RuntimeException( "Could get the id but not the localized id of the value of order " + order); return name;
public boolean hasPkColumnMapping(final String column) { if (ids.size() > 1) { return false; } for (final Id id : ids.values()) { if (column.equals(id.getColumn().getName())) { return true; } } return false; } }
superclass.addField(new Id(fieldName)); mapping.addField(new Id(fieldName)); final Id field = new Id(fieldName); field.setGeneratedValue(new GeneratedValue(GenerationType.AUTO)); mapping.addField(field); primaryKeyFields.add(fieldName); if (superclass != null) { superclass.addField(new Id(pkFieldName)); mapping.addField(new AttributeOverride(pkFieldName)); idclass = resolveIdClass(idclass, superclass, beanClass); } else { mapping.addField(new Id(pkFieldName));
id.setGeneratedValue(new GeneratedValue(GenerationType.IDENTITY));
throw new IllegalStateException("Primary key field " + fieldName + " is not defined in class " + ejbClassName + " or any super classes"); superclass.addField(new Id(fieldName)); mapping.addField(new AttributeOverride(fieldName)); primaryKeyFields.add(fieldName); final Id field = new Id(fieldName); field.setGeneratedValue(new GeneratedValue(GenerationType.AUTO)); mapping.addField(field); } else if (bean.getPrimKeyClass() != null) { superclass.addField(new Id(fieldName)); mapping.addField(new AttributeOverride(fieldName)); primaryKeyFields.add(fieldName);
id.setGeneratedValue(new GeneratedValue(GenerationType.IDENTITY));
throw new IllegalStateException("Primary key field " + fieldName + " is not defined in class " + ejbClassName + " or any super classes"); superclass.addField(new Id(fieldName)); mapping.addField(new AttributeOverride(fieldName)); primaryKeyFields.add(fieldName); final Id field = new Id(fieldName); field.setGeneratedValue(new GeneratedValue(GenerationType.AUTO)); mapping.addField(field); } else if (bean.getPrimKeyClass() != null) { superclass.addField(new Id(fieldName)); mapping.addField(new AttributeOverride(fieldName)); primaryKeyFields.add(fieldName);
this.fields.put(id.getName(), id);
/** * Create an instance of {@link Id } * */ public Id createId() { return new Id(); }
public boolean hasPkColumnMapping(String column) { if (ids.size() > 1) return false; for (Id id : ids.values()) { if (column.equals(id.getColumn().getName())) { return true; } } return false; } }
id.setGeneratedValue(new GeneratedValue(GenerationType.IDENTITY));
superclass.addField(new Id(fieldName)); mapping.addField(new Id(fieldName)); final Id field = new Id(fieldName); field.setGeneratedValue(new GeneratedValue(GenerationType.AUTO)); mapping.addField(field); primaryKeyFields.add(fieldName); if (superclass != null) { superclass.addField(new Id(pkFieldName)); mapping.addField(new AttributeOverride(pkFieldName)); idclass = resolveIdClass(idclass, superclass, beanClass); } else { mapping.addField(new Id(pkFieldName));
this.fields.put(id.getName(), id);
/** * Create an instance of {@link Id } */ public Id createId() { return new Id(); }
public boolean hasPkColumnMapping(final String column) { if (ids.size() > 1) { return false; } for (final Id id : ids.values()) { if (column.equals(id.getColumn().getName())) { return true; } } return false; } }
superclass.addField(new Id(fieldName)); mapping.addField(new Id(fieldName)); Id field = new Id(fieldName); field.setGeneratedValue(new GeneratedValue(GenerationType.AUTO)); mapping.addField(field); primaryKeyFields.add(fieldName); if (superclass != null) { superclass.addField(new Id(pkFieldName)); mapping.addField(new AttributeOverride(pkFieldName)); idclass = resolveIdClass(idclass, superclass, beanClass); mapping.addField(new Id(pkFieldName));
if (attributes != null) { for (Id id : attributes.getId()) { String name = id.getName(); ids.put(name, id); fields.put(name, id);
throw new IllegalStateException("Primary key field " + fieldName + " is not defined in class " + ejbClassName + " or any super classes"); superclass.addField(new Id(fieldName)); mapping.addField(new AttributeOverride(fieldName)); primaryKeyFields.add(fieldName); Id field = new Id(fieldName); field.setGeneratedValue(new GeneratedValue(GenerationType.AUTO)); mapping.addField(field); } else if (bean.getPrimKeyClass() != null) { superclass.addField(new Id(fieldName)); mapping.addField(new AttributeOverride(fieldName)); primaryKeyFields.add(fieldName);
if (attributes != null) { for (final Id id : attributes.getId()) { final String name = id.getName(); ids.put(name, id); fields.put(name, id);